Skip to content

Commit dbfe55a

Browse files
authored
Merge pull request tariqbuilds#421 from noygal/feature/bin-v2.0
added bin script file + port settings from env variable
2 parents 8ca02d2 + 24fc9c1 commit dbfe55a

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ See instructions for preferred server linux-dash server _(all included)_:
7474
npm install --production
7575

7676
## start linux-dash (on port 80 by default; may require sudo)
77+
## You may change this with the `LINUX_DASH_SERVER_PORT` environment variable (eg. `LINUX_DASH_SERVER_PORT=8080 node server`)
7778
node index.js
7879

7980
```

app/server/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ 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
89

9-
server.listen(80)
10-
console.log('Linux Dash Server Started!')
10+
server.listen(port, function() {
11+
console.log('Linux Dash Server Started on port ' + port + '!');
12+
})
1113

1214
app.use(express.static(path.resolve(__dirname + '/../')))
1315

bin/linux-dash

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
3+
require('../app/server/index.js')

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.0.0",
44
"description": "A simple, low overhead web dashboard for linux.",
55
"main": "app/server/index.js",
6+
"bin": "bin/linux-dash",
67
"repository": {
78
"type": "git",
89
"url": "https://github.com/afaqurk/linux-dash.git"

0 commit comments

Comments
 (0)