Dev Server
The Serve plugin starts a local static HTTP server so you can preview your generated site during development. It serves the files in output/ as they are: it does not open a browser, watch your files, or live-reload pages.
Overview
โก Instant Preview
Start a local server with a single command.
๐ Request Logging
Verbose mode logs all HTTP requests for debugging.
๐ Graceful Shutdown
Press Ctrl+C to stop and return to the interactive menu.
Installation
The Standalone edition has Serve built in. In the Full edition, install it from the bundled packages:
revela plugin install Serve
With the .NET tool, first register a folder containing the release's .nupkg files (see Plugins).
Usage
# Start server (default: port 8080)
revela serve
# Custom port
revela serve --port 3000
# Verbose mode (log all requests)
revela serve --verbose
Then open http://localhost:8080 in your browser.
Press Ctrl+C to stop the server.
Configuration
Settings are stored in project.json below plugins.serve:
{
"plugins": {
"serve": {
"port": 8080,
"verbose": false
}
}
}
| Option | Default | Description |
|---|---|---|
port |
8080 |
HTTP server port (1-65535) |
verbose |
false |
Log all requests (not just errors) |
# Configure interactively
revela config serve
# Or set a specific option
revela config serve --port 3000
Both commands also accept the short aliases -p (port) and -v (verbose). config serve writes project.json, so run it inside your project; in scripts and CI pass the options, because without a terminal it doesn't prompt and exits with 1. The settings can also be supplied as environment variables:
SPECTARA__REVELA__PLUGINS__SERVE__PORT=3000
SPECTARA__REVELA__PLUGINS__SERVE__VERBOSE=true
Values are resolved in order: CLI arguments โ environment variables โ project.json โ revela.json โ defaults.
Output
Standard mode โ only shows errors:
๐ Serving /home/jane/portfolio/output at http://localhost:8080
Press Ctrl+C to stop
โ 404: /favicon.ico
Verbose mode โ logs every request:
๐ Serving /home/jane/portfolio/output at http://localhost:8080
Press Ctrl+C to stop
GET /index.html 200
GET /_assets/main.css 200
GET /images/galleries/vacation/beach/640.avif 200
โ 404: /favicon.ico
Typical Workflow
# 1. Generate your site
revela generate all
# 2. Preview locally
revela serve
# 3. Make changes, regenerate, refresh browser
revela generate all
revela serve
Features
- Zero dependencies โ uses .NET's built-in
HttpListener - Correct MIME types โ HTML, CSS, JS, JSON, AVIF, WebP, JPG, PNG, SVG, ICO
- 404 logging โ missing files always shown, even in non-verbose mode
- 404 page โ missing files return status 404 with your site's generated
404.html, like on your web host - Hidden files stay hidden โ files and folders whose name starts with a dot (such as
.envor.git) answer 404; only/.well-known/is served - Production-like caching โ HTML is never cached; theme assets linked with a content version (
main.css?v=3f2a9c1d) are cached for a year like on your web host, since a changed file gets a new URL; other files for an hour - CLI overrides โ
--portand--verboseoverrideproject.jsonsettings - No live reload โ no file watching or browser auto-open; regenerate and refresh manually