Skip to content

Instantly share code, notes, and snippets.

@indreklasn
Created September 2, 2020 11:51
Show Gist options
  • Save indreklasn/8f7cae650757c321882fadb2b3202f26 to your computer and use it in GitHub Desktop.
Save indreklasn/8f7cae650757c321882fadb2b3202f26 to your computer and use it in GitHub Desktop.
debug example
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