list more addresses
This commit is contained in:
parent
423502d17c
commit
b057a53107
1 changed files with 7 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import { createServer } from "node:http";
|
||||||
import { publicPath } from "ultraviolet-static";
|
import { publicPath } from "ultraviolet-static";
|
||||||
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
|
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { hostname } from "node:os";
|
||||||
|
|
||||||
const bare = createBareServer("/bare/");
|
const bare = createBareServer("/bare/");
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
@ -45,8 +46,13 @@ if (isNaN(port)) port = 8080;
|
||||||
server.on("listening", () => {
|
server.on("listening", () => {
|
||||||
const address = server.address();
|
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(
|
console.log(
|
||||||
`Listening on http://${
|
`\thttp://${
|
||||||
address.family === "IPv6" ? `[${address.address}]` : address.address
|
address.family === "IPv6" ? `[${address.address}]` : address.address
|
||||||
}:${address.port}`
|
}:${address.port}`
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue