Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!