Serve a directory with file watching and live reload:
elide dev --no-tui ./publicdev listens on 127.0.0.1:3000 by default. It injects a small script into
served HTML that listens for reload events at /__elide_dev/livereload.
| Flag | Effect |
|---|---|
--host HOST | Change the bind host. |
--port PORT | Change the port. |
--no-tui | Use plain log output. |
--no-watch | Disable watching and live reload. |
For static serving without watching, use:
elide serve --no-tui ./distserve defaults to 127.0.0.1:8080. Both commands start a file server when
the subject is a directory; a script subject is run as a program instead.
JavaScript handlers
An entry ES module can export a fetch handler:
export default {
async fetch(request) {
return new Response("ok");
},
};Run it with elide run entrypoint.mjs, elide serve entrypoint.mjs, or
elide dev entrypoint.mjs. run uses exported hostname and port options,
falling back to 127.0.0.1:8080. serve uses 127.0.0.1:8080 and dev uses
127.0.0.1:3000; pass --host or --port to change their bind target.
A .js entry uses ES modules when its nearest package.json declares
"type": "module".
All three commands also support explicit Elide.serve({ port: 3005, fetch })
calls, which keep their own bind options. Interactive serve and dev show
the serving TUI with the listener’s address and completed requests. Use
--no-tui for plain output. Script changes do not yet trigger automatic reload.