How to storage data in server memory in Nextjs 13 app directory #55595
Unanswered
alexiglesiasmartinez
asked this question in
App Router
Replies: 2 comments
-
Any luck? |
Beta Was this translation helpful? Give feedback.
0 replies
-
How about using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a basic form in Nextjs with some validations and when I click on the submit button I handle the event and I create a JSON with the retrieved data.
Right now I'm doing a console.log of the JSON and everything goes pretty well.
What I need to do now is storage that JSON in the server memory, not in localStorage or sessionStorage (since this is client side), I want to save it just like in nodejs.
I know that it won't persist but I don't care, is just for a demo and learning purposes.
I created this API Route:
/app/api/addComunidad/route.js
I can't find any information on the Internet and ChatGPT and other AI only gives you legacy code that doesn't work in the Nextjs13 with the new app directory features
Beta Was this translation helpful? Give feedback.
All reactions