Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

167
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda