Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function printStartupMessage(server) {
if (!j79.isLogLevel('info')) {
return;
}
figlet.defaults({fontPath: "assets/fonts"});
console.log('');
console.log(HR);
figlet("nexl-server", function (err, data) {
if (err) {
throw 'Something went wrong...' + err
}
console.log(data);
console.log(HR);
var port = server.address().port;
var address = server.address().address;
console.log(chalk.green(util.format('\n%s', new Date())));
console.log(chalk.green(util.format("NEXL server is up and listening at [%s:%s]", address, port)));
});
}
function handleRootPage(req, res) {
figlet.defaults({fontPath: "assets/fonts"});
figlet("Welcome to nexl-server", function (err, data) {
if (err) {
nexlServerUtils.throw500Error('Something went wrong...' + err, res);
}
data = util.format('nexl-server version : %s\n%s', version, data);
res.status(200);
res.write(data);
res.end();
});
}