Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function defaultCallback(error) {
if (error) {
console.error(error.stack.toString());
} else {
console.log(
'hops: Server listening at ' +
url.format({
protocol: hopsConfig.https ? 'https' : 'http',
hostname:
hopsConfig.host === '0.0.0.0' ? 'localhost' : hopsConfig.host,
port: hopsConfig.port,
pathname: hopsConfig.basePath,
})
);
}
}
function listen(port) {
server.listen(port || hopsConfig.port, hopsConfig.host, function(error) {
(callback || defaultCallback)(error, server);
});
}
if (hopsConfig.port) {
exports.run = function run(app, callback) {
var server = app.listen(hopsConfig.port, hopsConfig.host, function(error) {
(callback || defaultCallback)(error, server);
});
};