1 | isFunction = (obj) -> '[object Function]' is toString.call obj
|
2 |
|
3 | module.exports = (view) ->
|
4 | throw new Error 'missing view' unless isFunction view
|
5 | (req, res, next) ->
|
6 | loaded = req.loaded || {}
|
7 | console.info 'rendering view with', Object.keys(loaded).toString()
|
8 | res.writeHead 200, 'Content-Type': 'text/html; charset=utf-8'
|
9 | res.end view loaded
|