From b057a531070b5af676ac8cca492c01e554b8ff87 Mon Sep 17 00:00:00 2001 From: David Reed Date: Sat, 3 Dec 2022 16:05:00 -0500 Subject: [PATCH] list more addresses --- src/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 14d75e7..42c58e4 100644 --- a/src/index.js +++ b/src/index.js @@ -4,6 +4,7 @@ import { createServer } from "node:http"; import { publicPath } from "ultraviolet-static"; import { uvPath } from "@titaniumnetwork-dev/ultraviolet"; import { join } from "node:path"; +import { hostname } from "node:os"; const bare = createBareServer("/bare/"); const app = express(); @@ -45,8 +46,13 @@ if (isNaN(port)) port = 8080; server.on("listening", () => { const address = server.address(); + // by default we are listening on 0.0.0.0 (every interface) + // we just need to list a few + console.log("Listening on:"); + console.log(`\thttp://localhost:${address.port}`); + console.log(`\thttp://${hostname()}:${address.port}`); console.log( - `Listening on http://${ + `\thttp://${ address.family === "IPv6" ? `[${address.address}]` : address.address }:${address.port}` );