Skip to content

Commit 6ad0c9c

Browse files
committed
Defualt host to network IP for network wide websites
1 parent 12e6525 commit 6ad0c9c

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ const url = require("url");
44
const fs = require("fs");
55
const path = require("path");
66
const qr = require("qrcode");
7+
var ip = require('ip');
78

8-
const port = process.argv[2] || 9000;
9-
const host = process.argv[3] || "localhost";
9+
const port = process.argv[2] || 8080;
10+
const host = process.argv[3] || ip.address();
1011

1112
http
1213
.createServer(function (req, res) {

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"homepage": "https://github.com/Quantalabs/pastebin#readme",
2323
"dependencies": {
2424
"formidable": "^2.0.1",
25+
"ip": "^1.1.5",
2526
"qrcode": "^1.5.0"
2627
},
2728
"devDependencies": {

0 commit comments

Comments
 (0)