Compress static files

This commit is contained in:
Rowan Manning
2013-11-05 11:58:57 +00:00
parent a8b1a2c09d
commit 98d948fd52

4
app.js
View File

@@ -18,6 +18,9 @@ function initApp (config, callback) {
app.server = http.createServer(app.express);
app.webservice = createClient(config.webservice);
// Compression
app.express.use(express.compress());
// Public files
app.express.use(express.static(__dirname + '/public', {
maxAge: (process.env.NODE_ENV === 'production' ? 604800 : 0)
@@ -25,7 +28,6 @@ function initApp (config, callback) {
// General express config
app.express.disable('x-powered-by');
app.express.use(express.compress());
app.express.use(express.bodyParser());
// View engine