Configuration
NukeJS works without any config. Create nuke.config.ts when you need to override defaults.
nuke.config.ts
Place this file at the project root. All options are optional.
nuke.config.tstypescript
export default {
// Directory for API route handlers
// Default: './server'
serverDir: './server',
// Dev server port
// Default: 3000 (auto-increments if port is in use)
port: 3000,
// Logging verbosity:
// false — silent (default)
// 'error' — errors only
// 'info' — startup messages + errors
// true — all debug output
debug: false,
}Options reference
| Option | Type | Default | Description |
|---|---|---|---|
| serverDir | string | './server' | Path to your API route handlers |
| port | number | 3000 | Dev server port |
| debug | boolean | 'error' | 'info' | false | Logging verbosity |
Environment variables
These environment variables control the production server:
| Variable | Description |
|---|---|
| ENVIRONMENT=production | Disables HMR and file watching |
| PORT | Port for the production HTTP server |
terminalbash
PORT=8080 ENVIRONMENT=production node dist/index.mjsTypeScript path aliases
If you want path aliases (e.g. @/components), add them to tsconfig.json:
tsconfig.jsonjson
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["app/*"]
}
}
}