Appearance
Nuxt
Fjordrun detects Nuxt from the nuxt dependency and builds it in one of two ways.
Server-side rendering (default)
With a normal Nuxt app, the builder runs your build script (nuxt build) and starts:
bash
node .output/server/index.mjson $PORT (Nitro reads PORT and HOST automatically). No configuration needed.
Runtime config
Nuxt reads NUXT_* variables when the server starts:
ts
// nuxt.config.ts
export default defineNuxtConfig({
runtimeConfig: {
apiSecret: '', // NUXT_API_SECRET
public: { apiBase: '' }, // NUXT_PUBLIC_API_BASE
},
})Set them in the service's Variables. Your local .env is not used in production. If the app crashes at boot complaining about a missing value, see Troubleshooting.
Static (SSG / SPA)
The site is generated and served by nginx when any of these is true:
ssr: falseinnuxt.config(single-page app: the builder runsnuxt generate, unknown routes fall back to200.html);nitro.presetisstaticorgithub-pages;- your
buildscript runsnuxt generate.
The output is .output/public. Runtime config in a static site is fixed at build time, so NUXT_PUBLIC_* variables must be set before the build.
Start command
Leave it empty. nuxt preview and nuxi dev are ignored as start commands, because they are not production servers.
Monorepos
If the Nuxt app is in app/ and reads files from outside it (for example ../design/images), set the root directory to app: the whole repository is still available to the build. See Root directory.