Skip to content

Commit b416f06

Browse files
committed
move server port to app config and use that in server.js
1 parent a4599d8 commit b416f06

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app.config.js.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const conf = {
2+
port:8081,
23
mysql: {
34
host: 'localhost',
45
user: 'root',

server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const express = require('express')
22
const app = express();
33
const parser = require('body-parser');
44
const storage = require('./src/server/storage');
5+
const appConfig = require('./app.config');
56

67
let mysqlMiddleware = function(req,res,next){
78
storage.saveTrace(req.body);
@@ -61,6 +62,6 @@ app.get('/install',(req,res)=>{
6162

6263
})
6364

64-
app.listen(8081,()=>{
65-
console.log('Express running on 8081');
65+
app.listen(appConfig.port,()=>{
66+
console.log('Express running on '+appConfig.port);
6667
});

0 commit comments

Comments
 (0)