ecko dev

ecko dev server.ecko

Runs the file and re-runs it whenever it changes on disk. Built for two cases: an HTTP server you are editing, and a script you are iterating on.

Servers

A server started with http.serve blocks. ecko dev stops the old process and starts the new one on each save, so a route change is live without a manual restart:

# server.ecko
import std.http
import std.web

routes = [
    { method: "GET", path: "/", handler: fn(req) http.text("hello") },
]

http.serve(8080, web.router(routes))
ecko dev server.ecko

Because the process restarts, in-memory state does not survive a reload. That is a feature while developing - it means you are always looking at the behaviour of the code as written, not of the code plus whatever the last version left in a cell.

Scripts

For a non-blocking script, each save prints a fresh run. It is a tight loop for working on a transformation or a prompt.

What it watches

Every file under the directory of the file you named, up to eight levels deep: .ecko source, and the files a web server typically serves (.html, .css, .js, .json, .md, images, fonts and the like). vendor/, target/ and dot-directories are skipped. A change to a sibling module or a template triggers the same reload as a change to the entrypoint.

When not to use it

Not a supervisor. It does not restart on crash, back off, or keep anything alive - it reacts to file changes and nothing else. Use a real process manager in production, and see Docker for deploying.