Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dvlkit/nuxe/llms.txt
Use this file to discover all available pages before exploring further.
nuxe.config.ts is optional. Create it at the project root and export defineConfig({ ... }) to customize Nuxe’s behavior. When the file is absent, Nuxe runs with sensible defaults — a dev server on port 3000, an API prefix of /api, and an empty runtime config.
Full example
The following is the playgroundnuxe.config.ts that exercises the most common options:
nuxe.config.ts
Options
server
Server configuration options. All sub-fields are optional; omitting the entire
server key is the same as passing an empty object.Port the dev server (and production server) listens on. Must be an integer
between 1 and 65535, inclusive. The final port is resolved in order:
the
PORT environment variable, then this config value, then the hardcoded
fallback of 3000.nuxe.config.ts
URL prefix under which all server API routes are mounted. Must start with
/
followed by at least one additional character — the value / alone is
rejected. Trailing slashes are stripped automatically. Defaults to /api.nuxe.config.ts
The regex that validates
apiPrefix is ^\\/(?!\\/) — it must begin with a
single / and the next character must not also be /. Values like //api
or api are invalid.vite
Any valid Vite
UserConfig. This object is
deeply merged with Nuxe’s internal Vite configuration, so you can extend
plugins, resolve aliases, or adjust build options without overriding Nuxe’s
required setup.nuxe.config.ts
runtimeConfig
Static runtime values available to server-side code. Any key nested under the
public sub-object is also exposed to the client. Keys at the top level are
server-only. Values can be strings, numbers, booleans, null, or nested
objects — arrays are not supported.nuxe.config.ts
NUXE_* environment
variables without a rebuild. See the Runtime Config
reference for the full override convention.
baseUrl
Base URL used by
useFetch when resolving relative request URLs on the
server. When this field is omitted, Nuxe falls back to the NUXE_BASE_URL
environment variable (which the CLI sets automatically at startup), and
ultimately to http://localhost:PORT if neither is set.nuxe.config.ts
Notes
nuxe.config.ts is loaded with c12, so
standard TypeScript and ESM syntax is supported out of the box — no extra
build step required.