Native support for exporting static files?
Unanswered
Snowshoe posted this in #help-forum
SnowshoeOP
Next.js offers support for building static files. However, this is only possible if you remove all APIs and server components. Is there a default configuration in next.config.js to tell that you only want to have the static files while also pointing to another backend like express.js? In case of static export, which backend is prefered by nextjs?
2 Replies
NextJS is a complete framework meaning you dont explicitly need a separate backend.
As such there is no recommended library for backend, however you can use it if you want to.
As such there is no recommended library for backend, however you can use it if you want to.
Also you dont have to remove APIs.
Server components can be static rendered at build time aswell.
The fetches are done at build-time. For client fetching etc you can still use normal fetch iirc and SWR if you want memoization.
Server components can be static rendered at build time aswell.
The fetches are done at build-time. For client fetching etc you can still use normal fetch iirc and SWR if you want memoization.