#Integrating API into NEXT.js deployment.

3 messages · Page 1 of 1 (latest)

brazen juniper
#

Hi, is it possible to integrate API into the next.js server? I have an API that my front end is going to use, it periodically fetches some data, composes it and then it's served to my front end application. I thought that maybe it's not neccessary for me to have 2 separate servers for those things (frontend + api) and I could run a data-fetching loop inside of my next.js deployment. I havent started the front end part of my project yet and I'm asking to know what my options are. I don't know if next.js server just sends pages to client and all code executes on client side, or I can run some of it on the server. Thanks in advance 🙇‍♂️

#

the question basically boils down to, can there be an infinite for loop running in the background and updating data on the server, while also serving the frontend app.

thorny linden