Development Server

Serve files with live reload, run fetch handlers, and replicate a server across contexts.

elide dev ./public
elide serve ./dist
CommandDefault addressWatches filesLive reload
elide dev127.0.0.1:3000YesStatic files only
elide serve127.0.0.1:8080NoNo

A directory subject starts a file server; a script subject runs as a program.

Starting the development server and observing a changed page
FlagEffect
--host HOSTBind host.
--port PORTBind port.
--no-tuiPlain log output instead of the TUI.
--no-watchdev only: no watching or reload.
--contexts=NRun 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.mjs

elide 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.