Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.

Static HTTP Server

Serve static files with a built-in HTTP server:

import http

http.serve("./public", port=3000, spa=True)
FunctionReturnsDescription
http.serve(directory, port?, host?, spa?)NoneStart a blocking static file server

Defaults: port=4000, host="127.0.0.1", spa=False. SPA mode serves index.html for paths that don't match a file (for client-side routing). Supports HTML, CSS, JS, JSON, SVG, images, WASM, and more.