Commit 0c77a1cb authored by Leo Iannacone's avatar Leo Iannacone

app: use compression by default for all request - save bandwith

parent dd70ebb5
...@@ -7,6 +7,7 @@ io = require("socket.io")(server) ...@@ -7,6 +7,7 @@ io = require("socket.io")(server)
serve_static = require("serve-static") serve_static = require("serve-static")
serve_index = require("serve-index") serve_index = require("serve-index")
compression = require("compression")
errorhandler = require("errorhandler") errorhandler = require("errorhandler")
routes = require("../routes") routes = require("../routes")
...@@ -24,6 +25,9 @@ if env is "development" ...@@ -24,6 +25,9 @@ if env is "development"
else else
app.use(errorhandler()) app.use(errorhandler())
# use compression by default
app.use(compression())
# the views # the views
app.set("views", __dirname + "/../views") app.set("views", __dirname + "/../views")
app.set("view engine", "ejs") app.set("view engine", "ejs")
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"serve-index": "*", "serve-index": "*",
"serve-static": "*", "serve-static": "*",
"errorhandler ": "*", "errorhandler ": "*",
"compression": "*",
"ejs": "1.*", "ejs": "1.*",
"socket.io": "1.2.*", "socket.io": "1.2.*",
"tail": "*", "tail": "*",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment