Using coffee instead (derby new --coffee first-project)

This commit is contained in:
Tyler Renelle
2012-04-26 22:19:31 -04:00
parent 2f8b80b74e
commit 45caad3c3c
9 changed files with 142 additions and 158 deletions

View File

@@ -1,21 +0,0 @@
var derby = require('derby')
, isProduction = derby.util.isProduction
module.exports = function(root) {
var staticPages = derby.createStatic(root)
return function(err, req, res, next) {
if (err == null) return next()
console.log(err.stack ? err.stack : err)
// Customize error handling here
var message = err.message || err.toString()
, status = parseInt(message)
if (status === 404) {
staticPages.render('404', res, {url: req.url}, 404)
} else {
res.send( ((status >= 400) && (status < 600)) ? status : 500)
}
}
}