#Next.js 13 - Run service in background on serverside?

4 messages · Page 1 of 1 (latest)

fickle mortar
#

Hi,
I need next.js to run one service instance in the background which should happen on serverside and not on clientside. So it should happen on the backend. Where would I place this service and where would I have to call it, that it is client independent?
I think this would fit into the 'api' directory but I dont know if this is supported in app mode.

I am using the app mode. Does the api folder work for it? Does it fit to my scenario?

Any help is welcome!

Thank you

umbral dawn
fickle mortar
#

@umbral dawn Thanks for your answer. It helped a little bit, now I know, that apis still go into pages directory.
But it seems that they are only activated per url call, which sadly doesnt suit to my problem 😦
Well it makes sence, as this is how an api works, but I still dont know how to achive my goal 😦

umbral dawn