Port from configfile
This commit is contained in:
parent
5ba8ca3bca
commit
e084a26833
5
bin/www
5
bin/www
@ -7,12 +7,15 @@
|
|||||||
var app = require('../app');
|
var app = require('../app');
|
||||||
var debug = require('debug')('uniScore:server');
|
var debug = require('debug')('uniScore:server');
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
var low = require('lowdb');
|
||||||
|
var config = low('config.json');
|
||||||
|
var portNumber = config.get('mainConfig').chain().find({ param: 'port' }).value()['value'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get port from environment and store in Express.
|
* Get port from environment and store in Express.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var port = normalizePort(process.env.PORT || '3000');
|
var port = normalizePort( portNumber || process.env.PORT || '3000');
|
||||||
app.set('port', port);
|
app.set('port', port);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
16
config.json.sample
Normal file
16
config.json.sample
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"mainConfig": [
|
||||||
|
{
|
||||||
|
"param": "port",
|
||||||
|
"value": "3030"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"param": "byeLabel",
|
||||||
|
"value": "0000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"param": "tbdLabel",
|
||||||
|
"value": "/dev/tty.usbmodemFD121"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -13,6 +13,7 @@
|
|||||||
"express": "~4.13.1",
|
"express": "~4.13.1",
|
||||||
"express-session": "^1.15.1",
|
"express-session": "^1.15.1",
|
||||||
"hbs": "~3.1.0",
|
"hbs": "~3.1.0",
|
||||||
|
"lowdb": "^0.16.0",
|
||||||
"morgan": "~1.6.1",
|
"morgan": "~1.6.1",
|
||||||
"serve-favicon": "~2.3.0",
|
"serve-favicon": "~2.3.0",
|
||||||
"socketio": "^1.0.0"
|
"socketio": "^1.0.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user