Skip to content

Instantly share code, notes, and snippets.

@falsecz
Created September 18, 2013 13:12
Show Gist options
  • Save falsecz/6608955 to your computer and use it in GitHub Desktop.
Save falsecz/6608955 to your computer and use it in GitHub Desktop.
$ = (next, success) => (err) =>
return next err if err
args = Array::slice.call arguments, 1
success.apply success, args
express = require 'express'
fs = require 'fs'
app = express()
app.get '/a', (req, res, next) ->
fs.readFile 'mrdka', 'utf-8', (err, data) ->
return next err if err
res.end data
app.get '/b', (req, res, next) ->
fs.readFile 'index.coffee', 'utf-8', $ next, (data) =>
res.end data
app.listen 5005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment