Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Caching in prod

  • Loading branch information...
commit 25f01282486db79a9014fc03e9f9eb440e2ce981 1 parent a1e7ba3
Crystal Chang authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 server.js
6 server.js
View
@@ -22,6 +22,12 @@ app.get('*', function(req,res) {
res.send('NO way jose',404);
});
+app.configure('production', function(){
+ var oneYear = 31557600000;
+ app.use(express.static(__dirname + '/public', { maxAge: oneYear }));
+ app.use(express.errorHandler());
+});
+
app.listen(23338);
function getURI(request) {
Please sign in to comment.
Something went wrong with that request. Please try again.