Getting Started
Use nubo serve to start an HTTP server.
nubo serve <file|folder>Serve a Folder
Section titled “Serve a Folder”A folder is treated as a routed server application.
nubo serve appExample structure:
app/ index.nubo about.nubo users/ [id].nuboServe One File
Section titled “Serve One File”When you serve one file, every request runs that file.
nubo serve app/index.nuboThis is useful for tiny apps, prototypes, and single-entry HTTP handlers.
Address
Section titled “Address”By default, the server uses the configured address.
runtime: server: address: ":3000"You can override it with --addr.
nubo serve app --addr ":8080"Server Startup Output
Section titled “Server Startup Output”When the server starts, it prints the Nubo web version, address, mode, and log level.
Nubo Web - <version>Server listening on :3000Mode: DEV | LogLevel: debugPress Ctrl+C to quitDevelopment Mode
Section titled “Development Mode”Use --dev to run in development mode.
nubo serve app --devIn development mode, the router is reloaded on each request when serving a directory. This makes route changes visible without restarting the server.
Request Lifecycle
Section titled “Request Lifecycle”For an executable .nubo route, Nubo:
- Matches the request path to a file.
- Parses or loads cached nodes for the file.
- Creates a runtime for the request.
- Provides
@server/request. - Provides
@server/response. - Interprets the matched
.nubofile. - Syncs the response to the HTTP client.