-
Notifications
You must be signed in to change notification settings - Fork 2
Hot Reload
Nadhi-(Kushi) edited this page Apr 1, 2026
·
2 revisions
The current dev reload story is built around three entry points:
app.reload(...)http-native dev <entry>createDevServer(...)
For older code, listen().hot() and @http-native/core/hot still exist as compatibility paths.
http-native dev ./server.ts --port 3000Options:
--host--port-
--watch path(repeatable) --debounce ms--no-clear
import { createApp } from "@http-native/core";
const app = createApp().reload({
files: ["src", "routes", "rsrc/src"],
debounceMs: 80,
clear: true,
});
app.get("/", (req, res) => {
res.json({ ok: true });
});
await app.listen().port(3000).hot();app.reload() stores the watch and reload settings on the app. .listen().hot() turns on the runtime reload path for self-starting apps.
import { createDevServer } from "@http-native/core/dev";
const dev = await createDevServer({
entry: "./server.ts",
port: 3000,
watch: ["src", "routes"],
debounceMs: 80,
clear: true,
});
console.log(dev.url);
console.log(dev.status());DevServerHandle exposes:
hostporturlstatus()reload(reason?)close()
import { hot } from "@http-native/core/hot";
await hot("./server.ts", {
port: 3000,
});- Reload keeps the active JS runtime. Bun stays on Bun. Node stays on Node.
-
app.reload()acceptswatchorfiles. - No hardcoded extension allowlist is required from the public API. You decide the watch roots.
-
close()is intended to stop the watcher and close the dev server immediately.
Http-native is open to everyone, but we have strict regulations and licensing fees for large organizations