Server Options
Application.start(options?) accepts ServerOptions.
Network
host?: stringport?: number
If port is omitted, Imperium tries APP_PORT from current app config (by default it starts with process.env).
Path Prefixes
prefix?: string(global)httpPrefix?: stringrpcPrefix?: string
Fastify Runtime Options
trustProxyrequestTimeoutconnectionTimeoutkeepAliveTimeoutbodyLimitrouterOptionspluginTimeoutmaxParamLength(legacy, deprecated in favor ofrouterOptions.maxParamLength)
Observability and Safety
accessLogs?: booleanexposeInternalErrors?: booleanloggerOptions?: LoggerOptions
CORS
cors?: boolean | CorsOptions
false or undefined disables CORS plugin registration.
Health
health?: boolean | HealthOptions
Use health: true for default /health endpoint, or custom object:
ts
health: {
enabled: true,
path: "/health",
check: async () => ({ ok: true, details: { db: "up" } }),
}Graceful Shutdown
gracefulShutdown?: boolean | GracefulShutdownOptions
Defaults:
- signals:
SIGINT,SIGTERM - timeout:
15000ms forceExitOnFailure: false
Built-in Config and Logger Injection
ServerOptions also supports:
config?: { schema, source? }loggerOptions?: LoggerOptions
For full control, prefer pre-start methods on Application:
ts
app.configureConfig(appConfigSchema, process.env);
app.configureLogger(loggerOptions);
await app.start({ port: 8000 });