Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dir: __dirname,
interactive: false
})
);
upwardServerOptions.host = hostname;
upwardServerOptions.https = ssl;
upwardServerOptions.port = envPort || ports.staging || 0;
} catch (e) {
console.log(
'Could not configure or access custom host. Using loopback...',
e.message
);
}
}
console.log('Launching UPWARD server\n');
await createUpwardServer(upwardServerOptions);
console.log('\nUPWARD server running.');
}
async function serve() {
const config = loadEnvironment(__dirname);
const upwardServerOptions = Object.assign(
{},
config.section('upwardJs'),
config.section('stagingServer'),
{
env: process.env,
before: app => {
app.use(bestPractices());
}
}
);
const server = await createUpwardServer(upwardServerOptions);
return server;
}