chore(server): console feedback at server listening event
This commit is contained in:
@@ -2,7 +2,7 @@ import { concat } from 'ramda'
|
||||
|
||||
const prependDeemix = concat('[deemix-server]: ')
|
||||
|
||||
export const consoleInfo = (errorText: string) => console.info(prependDeemix(errorText))
|
||||
export const consoleInfo = (infoText: string) => console.info(prependDeemix(infoText))
|
||||
export const consoleError = (errorText: string) => console.error(prependDeemix(errorText))
|
||||
|
||||
export class BadRequestError extends Error {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import http from 'http'
|
||||
import type { Debugger } from 'debug'
|
||||
import { consoleInfo } from './errors'
|
||||
|
||||
/**
|
||||
* Event listener for HTTP server "error" event.
|
||||
@@ -41,7 +42,9 @@ export function getListeningCb(server: http.Server, debug: Debugger) {
|
||||
|
||||
if (addr) {
|
||||
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port
|
||||
debug('Listening on ' + bind)
|
||||
|
||||
debug(`Listening on ${bind}`)
|
||||
consoleInfo(`Listening on ${bind}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user