Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function startServer(app) {
let vipServer;
if ('development' !== NODE_ENV) {
vipServer = server(app, { PORT });
vipServer.listen();
}
return vipServer;
};
const os = require('os');
const fs = require('fs');
const path = require('path');
const key = fs.readFileSync(
path.join(os.homedir(), HTTPS_KEY_PATH),
'utf8'
);
const cert = fs.readFileSync(
path.join(os.homedir(), HTTPS_CERT_PATH),
'utf8'
);
irvingServer = https.createServer({ key, cert }, app);
} else {
irvingServer = server(app, { PORT });
}
return irvingServer;
};