N
Nuxt7mo ago
jakesdev

server/api not working on nuxt generate

Hi, i want to prerender all of my routes to html static page. I use nuxt generate to do that. But i have some function on server/api folder like upload/delete/get files from server (i save it locally on server) that not working if i use nuxt generate. Is that other way to handle this. Sorry for my english 🤓. Thanks for all helps
2 Replies
Cue
Cue7mo ago
You cannot utilise server routes on a statically generated site beyond assisting the rendering of the site. That is, a server route/api is requested at build time and cannot be subsequently requested at runtime. You would need to run the server in a node environment or alike to grant runtime access to said routes.
jakesdev
jakesdevOP7mo ago
Thank you 🫶
Want results from more Discord servers?
Add your server