elide dev ./public
elide serve ./dist| Command | Default address | Watches files | Live reload |
|---|---|---|---|
elide dev | 127.0.0.1:3000 | Yes | Static files only |
elide serve | 127.0.0.1:8080 | No | No |
A directory subject starts a file server; a script subject runs as a program.
| Flag | Effect |
|---|---|
--host HOST | Bind host. |
--port PORT | Bind port. |
--no-tui | Plain log output instead of the TUI. |
--no-watch | dev only: no watching or reload. |
--contexts=N | Run N copies of the app; auto sizes from the CPU cores. Linux only. |
Fetch handlers
// entrypoint.mjs
export default {
async fetch(request) {
return new Response("ok");
},
};elide serve entrypoint.mjselide run entrypoint.mjs also serves, on the exported hostname and port or 127.0.0.1:8080.
Elide.serve({ port: 3005, fetch }) uses its own address with every command.
Replicated serving
elide serve --contexts=4 entrypoint.mjs- Each context runs the entry module once and keeps its own globals; a request counter counts per context.
- A connection stays on one context for its lifetime, including keep-alive requests.
- If one context fails, the server stops.
Set engine.contexts in elide.pkl for finer control; see Engine contexts.