Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
Express app.get() How to refer to each element of an array one by one

Trying to create a script that will collect data from API and as soon it finished gathering data from the first page it must navigate to the second page.

Tried this

module.exports = async function (app, pool, fetch) {
    app.get('/getdata123/', async function (req, res) {
    const category_title = ['users', 'unknown'];

                        let urlApart = 'https://reqres.in/api/'; //url of page
                        
                        let url = urlApart + category_title ;
                        console.log (url);  
    }); 

}

and it returned the "https://reqres.in/api/users,unknown"

I want something like "https://reqres.in/api/users" than script collected needed data and moved to "https://reqres.in/api/unknown" to collect the same parameters on second page

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can map over category_title and it'll give you [ "https://reqres.in/api/users", "https://reqres.in/api/unknown"] which you could then use to achieve your end goal.

const category_titles = ['users', 'unknown'].map(title => `https://reqres.in/api/${title}`);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda