Merge two response data in one - NodeJS

0 votes

I want to merge the output from two different API calls into a single JSON answer using a NodeJS server that receives data from two different APIs. I'll send you the code right here:

EventModal.eventSearch(eventReq, type, async function (eventRes) {
       EventModal.getBoostEvents(eventReq, type, async function (eventBoostRes) {
                           res.json({
                                status: true,
                                data: eventRes,
                                eventBoostRes: eventBoostRes,
                            });
        });
  });

I want eventRes and eventBoostRes in one response in data.So how can I achieve that ?

eventRes and eventBoostRes are query result.

Thanks in advance.

Jun 27 in Node-js by Vaani
• 7,020 points
27 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Node-js

0 votes
1 answer

Fill Data In Existing PDF Form Using NodeJS

Check out the following modules on npm: fill-pdf pdffiller pdf-fill-form node-pdffiller pdfkit The node-pdffilleris ...READ MORE

answered Jun 10 in Node-js by Neha
• 8,740 points
104 views
0 votes
0 answers

How to transfer data from a controller to a socket.io in nodejs?

I'm developing a web application that will ...READ MORE

Jun 23 in Node-js by Vaani
• 7,020 points
65 views
0 votes
1 answer

How do I “include” functions from my other files in nodejs?

Hello @kartik, You require any js file,so you just ...READ MORE

answered Jul 9, 2020 in Node-js by Niroj
• 82,740 points
1,633 views
0 votes
1 answer

How to process POST data in Node.js?

Hello @kartik, You can use the querystring module: var qs = ...READ MORE

answered Jul 9, 2020 in Node-js by Niroj
• 82,740 points
1,642 views
0 votes
1 answer

Error:npm WARN unmet dependency in nodejs

Hii @kartik, Following are the possible solution : Manually ...READ MORE

answered Jul 12, 2020 in Node-js by Niroj
• 82,740 points
2,925 views
0 votes
1 answer

How to get the _id of inserted document in Mongo database in NodeJS?

Hello @kartik, A shorter way than using second ...READ MORE

answered Sep 7, 2020 in Node-js by Niroj
• 82,740 points
8,460 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,007 views
0 votes
1 answer
0 votes
0 answers

How to integrate soap xml API of unicommerce in nodejs

I am trying to hit xml Api ...READ MORE

4 days ago in Node-js by Neha
• 8,740 points
7 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP