Is there any way to keep an object and its content on API side in nextJs?
I want to have a singleton and use it in all my requests. but when I importing create a new instance for each request.
Is there any way to keep an object and its content on API side in nextJs?
I want to have a singleton and use it in all my requests. but when I importing create a new instance for each request.
You can use Symbol.for and the Node global to mantain an instance saved somewhere in the server.