Skip to content

Instantly share code, notes, and snippets.

View adam8810's full-sized avatar

Adam Booth adam8810

  • Oklahoma City
View GitHub Profile
@adam8810
adam8810 / 0_reuse_code.js
Last active August 31, 2015 13:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@adam8810
adam8810 / logging.js
Last active February 1, 2025 00:36
A simple node module that makes console.log/error/warn/debug statements log through winston (simply include at the beginning of your app)
'use strict';
var util = require('util'),
winston = require('winston'),
logger = new winston.Logger(),
production = (process.env.NODE_ENV || '').toLowerCase() === 'production';
module.exports = {
middleware: function(req, res, next){
console.info(req.method, req.url, res.statusCode);