Skip to main content

Static file serving and directory listing.

# To start an HTTP server listening on the default port to serve the current directory:
serve

# To start an HTTP server on a specific [p]ort to serve a specific directory:
serve -p <port> <path/to/directory>

# To start an HTTP server with CORS enabled by including the 'Access-Control-Allow-Origin: *' header in all responses:
serve --cors

# To start an HTTP server on the default port rewriting all not-found requests to the 'index.html' file:
serve --single

# To start an HTTPS server on the default port using the specified certificate:
serve --ssl-cert <path/to/cert.pem> --ssl-key <path/to/key.pem>

# To start an HTTP server on the default port using a specific configuration file:
serve --config <path/to/serve.json>

# To display help:
serve --help