commit 729f2e96aa7a62d73346dc7728ce8653c20b46e5
parent a4468f46b7adee23e49ad825f217d5a2ac8d676b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 5 Oct 2026 12:47:53 -0400
export: serve-out binds HOST when set (a private site can stay on this machine)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/export/scripts/serve-out.mjs b/export/scripts/serve-out.mjs
@@ -12,6 +12,8 @@
// Byte ranges are honoured (a media element asks for them).
//
// node scripts/serve-out.mjs <dir> <port>
+//
+// Every interface, as `serve` did; `HOST=127.0.0.1` keeps a private site on this machine.
import fs from "node:fs";
import http from "node:http";
@@ -115,4 +117,5 @@ http
if (statOrNull(notFound)?.isFile()) return sendFile(req, res, notFound, 404);
res.writeHead(404).end();
})
- .listen(PORT, () => console.log(`[serve-out] serving ${ROOT} on http://localhost:${PORT}`));
+ .listen(PORT, process.env.HOST || undefined, () =>
+ console.log(`[serve-out] serving ${ROOT} on http://${process.env.HOST || "localhost"}:${PORT}`));