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, 2022 in Node-js by Vaani
• 7,020 points
994 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, 2022 in Node-js by Neha
• 9,060 points
2,507 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, 2022 in Node-js by Vaani
• 7,020 points
2,300 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,880 points
3,015 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,880 points
2,333 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,880 points
5,708 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,880 points
13,133 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,691 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,232 views
0 votes
0 answers

How to integrate soap xml API of unicommerce in nodejs

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

Aug 11, 2022 in Node-js by Neha
• 9,060 points
495 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP