updated app

This commit is contained in:
2012-05-30 23:00:06 -04:00
parent 6a753904b7
commit da6ad88d48
5545 changed files with 1101709 additions and 60 deletions

36
node_modules/derby-examples/sink/lib/server/index.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
// Generated by CoffeeScript 1.3.1
var ONE_YEAR, app, derby, express, expressApp, gzippo, http, path, publicPath, root, server, serverError;
http = require('http');
path = require('path');
express = require('express');
gzippo = require('gzippo');
derby = require('derby');
app = require('../app');
serverError = require('./serverError');
ONE_YEAR = 1000 * 60 * 60 * 24 * 365;
root = path.dirname(path.dirname(__dirname));
publicPath = path.join(root, 'public');
(expressApp = express()).use(express.favicon()).use(gzippo.staticGzip(publicPath, {
maxAge: ONE_YEAR
})).use(express.compress()).use(express.bodyParser()).use(express.methodOverride()).use(app.router()).use(expressApp.router).use(serverError(root));
module.exports = server = http.createServer(expressApp);
expressApp.all('*', function(req) {
throw "404: " + req.url;
});
app.createStore({
listen: server
});

View File

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