Log basic server information after an http server start as ndjson.
- log local url (useful for tools like opnr)
- log port
- log environment
- log process id (useful for
dtrace(1)
,kill(1)
)
const summary = require('server-summary')
const http = require('http')
const bole = require('bole')
const log = bole('my-server')
process.env.NODE_ENV = 'development'
const server = http.createServer()
server.listen(1337, summary(server, log.info))
Knowing on what port your server is listening is nice to have. This module
logs some basic information after your server has started to stdout
.
$ npm install server-summary