Interaction between NEXTJS and NODEJS.
Answered
Giant Angora posted this in #help-forum
Giant AngoraOP
Hello All!
I have project (a simple web application) in which the frontend is created completely in Next.js and the backend is yet to be created, DB will be MySQL.
Now the backend needs to be created using Node.js not Next.js, please could you guide me
, specifically on connecting the NextJS and NodeJS?
I have project (a simple web application) in which the frontend is created completely in Next.js and the backend is yet to be created, DB will be MySQL.
Now the backend needs to be created using Node.js not Next.js, please could you guide me
, specifically on connecting the NextJS and NodeJS?10 Replies
Next.js works as a simple backend framework too
so you dont need an external back-end unless you need to
@alfon Next.js works as a simple backend framework too
Giant AngoraOP
You are 100 percent correct but I need the back end in nodejs. 

Well you could just run Next.js and Node.js in parallel
in a different port
Giant AngoraOP
Yes. But we do need something in the middle to do a connection?
you can call fetch() to the endpoint of your Node.js
Answer
and treat your Node.js server just like any other external endpoints
Giant AngoraOP
Ok let me try
Giant AngoraOP
Fetch using Axios did the job. Thank you.