Created
August 17, 2015 20:54
-
-
Save adam-lynch/2c00fcbe18fcb5c4b85a to your computer and use it in GitHub Desktop.
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
browserSync = require 'browsersync' | |
# if you're using gulp, replace this with `require('gulp-util').colors` | |
chalk = require 'chalk' | |
# method - {String} (uppercase) | |
colourMethod = (method) -> | |
map = | |
'GET': 'green' | |
'POST': 'yellow' | |
'PUT': 'blue' | |
'DELETE': 'red' | |
if map[method]? | |
return chalk[map[method]] method | |
else | |
return method | |
browserSync | |
server: | |
baseDir: 'blah' | |
middleware: (req, res, next) -> | |
# if you're using gulp, replace `console.log` with `require('gulp-util').log` | |
console.log colourMethod(req.method), req.url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment