This commit is contained in:
Zef Hemel
2022-12-16 13:00:06 +01:00
parent 74c4694af6
commit 0314e3025f
4 changed files with 15 additions and 9 deletions
+9 -6
View File
@@ -5,17 +5,20 @@ import { AssetBundle, AssetJson } from "../plugos/asset_bundle/bundle.ts";
export function serveCommand(options: any, folder: string) {
const pagesPath = path.resolve(Deno.cwd(), folder);
const hostname = options.hostname || "0.0.0.0";
const hostname = options.hostname || "127.0.0.1";
const port = options.port || 3000;
console.log(
"Going to start Silver Bullet on",
"Going to start Silver Bullet binding to",
`${hostname}:${port}`,
"serving pages from",
pagesPath,
"with db file",
options.db,
);
console.log("Serving pages from", pagesPath);
if (hostname === "127.0.0.1") {
console.log(
`_Note:_ Silver Bullet will only be available locally (via http://localhost:${port}), to allow outside connections, pass --host 0.0.0.0 as a flag.`,
);
}
const httpServer = new HttpServer({
hostname,