koa = require('koa') app = koa() # x-response-time app.use (next) ->* start = new Date yield next ms = new Date - start @set 'X-Response-Time', "#{ms}ms" # logger app.use (next) ->* start = new Date yield next ms = new Date - start console.log "#{@method} #{@url} - #{ms}" # response app.use (next) ->* @body = 'Hello World' app.listen 3000