Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8508015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:02:17+00:00 2026-06-11T03:02:17+00:00

Building my first serious Node.js project (using Express). I need to use several calls

  • 0

Building my first “serious” Node.js project (using Express).

I need to use several calls to several REST APIs, collect all the results, massage them and return a complete JSON to the client (HTML5 + AJAX).

  1. Call API A
  2. Call API B
  3. Call API A again (with results from B)
  4. Process results from the 3 calls into a JSON
  5. response.send(result)

I’m sure/hoping there’s an easy pattern, or solution, or module that I just didn’t google properly for 🙂
I’d also would appreciate an opinion on where to place such operations (under ‘routes’? Seperate files? etc.)

Thanks for your time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:02:18+00:00Added an answer on June 11, 2026 at 3:02 am

    The async module fits into this kind of job. Specifically, you may use the async.waterfall function.

    Example:

    async.waterfall([
        function(callback){
            callback(null, 'one', 'two');
        },
        function(arg1, arg2, callback){
            callback(null, 'three');
        },
        function(arg1, callback){
            // arg1 now equals 'three'
            callback(null, 'done');
        }
    ], function (err, result) {
       // result now equals 'done'    
    });
    

    Edit, if you have some nontrivial dependencies between the jobs, then you may use async.auto. It will determine the best order for running functions based on their requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im building my first application using CodeIgniter, i need a bit of advice. There
I'm relatively new to progrmming and am building my first serious client app. On
My team is building our first significant Silverlight application, using a 3 layered architecture
I'm building my first CodeIgniter app - and have a registration form. I'm using
I'm building my first personal website using Zend 1.11. To create the directory structure
Building my first WP theme and I quickly realized that I need to remove
I building my first cake PHP application, all things configured correctly, but when i
I'm building my first Zend/Doctrine project and would like to be able to access
Hi I'm building my first MVC 2 app and I'm really confused by all
Building my first web app using Yii and wondering if it is best to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.