UNPKG

noide

Version:

Web Editor built on hapi and nes websockets using browserify, superviews.js, bootstrap and the ACE editor.

21 lines (16 loc) 502 B
var Joi = require('joi') var path = require('path') var argv = require('./argv') var schema = require('./schema') var config = require(argv.server ? path.resolve(process.cwd(), argv.server) : './server.json') if (process.env.PORT) { config.server.port = process.env.PORT } Joi.validate(config, schema, function (err, value) { if (err) { throw new Error('The server config is invalid. ' + err.message) } // Update config with validated object config = value }) module.exports = config