Skip to content

Configuration options ​

PropertyTypeDefaultDescription
rootstringNoneBase for relative paths. Required for programmatic use and set automatically by the CLI
publicstring"../public/main"Static file directory, as an absolute path or relative to root
apistring"/api"Path where the HTTP API is mounted
portnumber3000Integer from 0 to 65535. With 0, the OS assigns an available port
middlewaresexpress.RequestHandler[][]Express middleware added before APIs and static file serving
lanbooleanfalseListens on 0.0.0.0 when true, or 127.0.0.1 when false
qrbooleanfalseDisplays a QR code for the network URL in the terminal
browserboolean | "local" | "lan"falseURL to open after startup. true is the same as "local"
autoPortbooleanfalseIncrements the port until an available one is found when the requested port is in use
signalClosebooleantrueRuns shutdown handling on SIGINT / SIGTERM
languagestring"ja-JP"Language for server and CLI messages
guiboolean | { allowLan?: boolean }falseServes the built-in management GUI at /__tyoi/

browser ​

ValueBehavior
falseDoes not open a browser
trueOpens the local URL
"local"Opens the local URL
"lan"Opens the network URL when lan: true; otherwise warns and opens the local URL

autoPort ​

When the requested port is in use and autoPort: true, the server increments the port number until one is available. When it is false, the CLI asks whether to use the next port and startup fails if you decline.

After startup, getPort() returns the port that is actually in use.

gui ​

With false, the management GUI is not registered. true is equivalent to { allowLan: false } and provides Summary, Status, and Live Log at /__tyoi/ on the same server. The management APIs use /__tyoi/api/* and real-time logs use /__tyoi/ws, independently of the public api setting.

By default, HTTP and WebSocket requests are accepted only when the socket peer is a loopback address. LAN access requires both lan: true and gui: { allowLan: true }. With this configuration, project paths, configuration, and logs are visible without authentication to everyone who can reach the server. Enable it only on a trusted network.

See Built-in management GUI for screen and endpoint details.

Validation ​

defineConfig() validates the configuration with a Zod schema and throws a ZodError for an invalid type, range, or unknown property. Unknown properties are also TypeScript errors.