This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nconf = require('nconf'); | |
const _ = require('lodash'); | |
const loadSettings = ({ appSettingsPath }) => new Promise((resolve, reject) => { | |
try { | |
if (_.isEmpty(appSettingsPath)) { | |
throw new Error('Configuration settings path is required.'); | |
} | |
nconf.file({ | |
file: appSettingsPath, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"logSeverity": "info" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import dependencies from npm | |
const Fastify = require('fastify'); | |
const path = require('path'); | |
const AutoLoad = require('fastify-autoload'); | |
const uuidv4 = require('uuid/v4'); | |
// create request ids | |
const createRequestId = () => uuidv4(); | |
// create the server |
NewerOlder