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 8408961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:46:33+00:00 2026-06-09T23:46:33+00:00

I am a newbie to node and js and try to create a website

  • 0

I am a newbie to node and js and try to create a website in express that makes three Rest API calls before rendering the page. At the moment I have the below, which returns some json which I convert into a list of objects.

Some of these properties only return id values and I would like to run three more API requests that return lookups on these Id’s so that I can present this data to the user as meaningful values.

I could do this synchronously by running the next API call where I am currently rendering the index page, but that looks really messy. All the async tutorials I have seen confuse the hell out of my newbie way of thinking though. Can someone post an easy to follow example for async that somewhat reflects the below structure?

var issues_json = "";
var request = http.request(options, function(response) {
    console.log("statusCode: ", res.statusCode);
    console.log("headers: ", res.headers);

    response.on("data", function(data) {
        issues_json += data;
    });

    response.on("end", function() {
        console.log(issues_json);
        var column_obj = JSON.parse(issues_json);
        res.render('index', {
            title: 'List of Issues',
            response: issues_json,
            objects: column_obj
        });
    });

    response.on("error", function(e) {
        console.log(e.Message);
        res.render('index', {
            title: 'error',
            e: e.Message
        });
    });
});
request.end();
  • 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-09T23:46:34+00:00Added an answer on June 9, 2026 at 11:46 pm

    You should use Request

    You would have something like

    app.get("/route", function(req, res) {
    
      var callbackThree = function(error, resp, body) {
        var data = JSON.parse(body);
        res.send({title; "My Title", data: data});
      }
    
      var callbackTwo = function(error, resp, body) {
        request("api.com/42", callBackThree);
      }
    
      var callbackOne = function(error, resp, body) {
        request("api.com/things", callBackTwo);
      }
    
      request("api.com/users", callBackOne);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a newbie. I'm using a browser plugin that hits my node server, and
I am a newbie in Node.js (and Express) and I am trying to make
Newbie question: I just installed VisualSVN Server and created a repository. I noticed that
Newbie question: There are three types of Asp.Net controls : HTML server controls, Web
Newbie question. I have Django models that look like this: class Video(models.Model): uploaded_by =
I'm a Mac newbie and just upgraded to Node.js 0.67. After running node, the
Newbie question on xslt. I've multiple xsl:if checks like <xsl:if test=node/node1> ...</xsl:if> ... <xsl:if
Newbie C++ programmer here. I'm trying to write a command line application that takes
I am newbie to LINQ. I am trying to read the following node and
Hi Everyone I am newbie to Express + NodeJS. I come from Java and

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.