[Breaking] Change config.js to config.json

This commit is contained in:
Ceda EI 2019-07-27 20:40:50 +05:30
parent 240a9f7fde
commit af28e0c5d9
3 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ node_modules
*.swo *.swo
data data
*.DS_Store *.DS_Store
config.json

View File

@ -12,7 +12,7 @@ var connect_rate_limit = require('connect-ratelimit');
var DocumentHandler = require('./lib/document_handler'); var DocumentHandler = require('./lib/document_handler');
// Load the configuration and set some defaults // Load the configuration and set some defaults
var config = JSON.parse(fs.readFileSync('./config.js', 'utf8')); var config = require('./config.json');
config.port = process.env.PORT || config.port || 7777; config.port = process.env.PORT || config.port || 7777;
config.host = process.env.HOST || config.host || 'localhost'; config.host = process.env.HOST || config.host || 'localhost';