Skip to content

Instantly share code, notes, and snippets.

@tarusharora
Created December 28, 2018 22:59
Show Gist options
  • Save tarusharora/38439f22d9429e4b51d563dfb9d8cc63 to your computer and use it in GitHub Desktop.
Save tarusharora/38439f22d9429e4b51d563dfb9d8cc63 to your computer and use it in GitHub Desktop.
App.js Basic
const nconf = require('nconf');
const server = require('./server');
const { loadSettings } = require('./config/configurationAdaptor');
const appSettingsPath = process.env.APP_SETTINGS_FILE_PATH;
loadSettings({ appSettingsPath })
.then(() => {
// TODO Connect to DB, if any.
// Read the config property required for starting the server
const serverOptions = {
logSeverity: nconf.get('logSeverity'),
};
server.createServer(serverOptions);
// TODO Start the server
})
.catch((err) => {
console.log(err);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment