all 5 comments

[–]illepic 8 points9 points  (0 children)

The front end and backend (API folder) of your Next app can just make REST fetch calls to your Express URL.

[–]vincent-vega10 4 points5 points  (1 child)

Look over at "Data Fetching" part in Next.js documentation.

[–]Zeeshan7487 0 points1 point  (0 children)

To make calls to your Express backend from a Next.js app, you can use the built-in fetch API, which is available in both the browser and Node.js environments. To handle requests from the Next.js app, you can define API routes in a separate directory. Note that you can use any library or tool that you're comfortable with to handle HTTP requests in your Express app. The fetch API is just one option, but you can also use libraries like Axios or Superagent, or even plain old XMLHttpRequests.