(async() => { const debug = _debug('app:bin:server') const port = config.server_port const host = config.server_host try { let app = await Server(config) app.listen(port) debug(`Server is now running at http://${host}:${port}.`) debug(`Server accessible via localhost:${port} if you are using the project defaults.`) } catch (e) { console.log(e) } })()
const Logger = function() { let _debug = require("debug"); let _debugLogger = _debug("skyapm:debug"); let _infoLogger = _debug("skyapm:info"); let _warnLogger = _debug("skyapm:warn"); let _errorLogger = _debug("skyapm:error"); this.debug = function(className, format, ...args) { _debugLogger("[%s] " + format, className, ...args); }; this.info = function(className, format, ...args) { _infoLogger("[%s] " + format, className, ...args); }; this.warn = function(className, format, ...args) { _warnLogger("[%s] " + format, className, ...args); }; this.error = function(className, format, ...args) { _errorLogger("[%s] " + format, className, ...args); }; }
const execute = () => { let app = express() const debug = _debug('app:api:server') app.use(parser.urlencoded({ extended: true })) app.use(parser.json())