Skip to content

Commit 49728ba

Browse files
author
Afaq Tariq
committed
added --port flag to node.js server
1 parent 0be8a22 commit 49728ba

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/server/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ var path = require('path')
55
var spawn = require('child_process').spawn
66
var fs = require('fs')
77
var ws = require('websocket').server
8-
var port = process.env.LINUX_DASH_SERVER_PORT || 80
8+
var args = require('yargs').argv
9+
var port = args.port || process.env.LINUX_DASH_SERVER_PORT || 80
910

1011
server.listen(port, function() {
1112
console.log('Linux Dash Server Started on port ' + port + '!');

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"homepage": "https://github.com/afaqurk/linux-dash",
2424
"dependencies": {
2525
"express": "^4.11.1",
26-
"websocket": "^1.0.23"
26+
"websocket": "^1.0.23",
27+
"yargs": "^8.0.1"
2728
},
2829
"devDependencies": {
2930
"angular": "1.3.4",

0 commit comments

Comments
 (0)