Created
September 2, 2020 11:51
-
-
Save indreklasn/8f7cae650757c321882fadb2b3202f26 to your computer and use it in GitHub Desktop.
debug example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const debug = require('debug'); | |
const log = debug('http:server'); | |
const http = require('http'); | |
const name = 'My App name'; | |
log('booting %o', name); | |
http.createServer((req, res) => { | |
log(req.method + ' ' + req.url); | |
res.end('debug examplen'); | |
}).listen(3200, () => { | |
log('listening'); | |
}); | |
// run this command in the terminal | |
// DEBUG=http:server node app.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment