Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Fixed locals.cache when NODE_ENV==='production'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-André Bélanger committed Apr 12, 2014
1 parent c9d641e commit 16f3393
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/routes/articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module.exports = function(app) {

app.route('/articles/:articleId')
.get(articles.read)
.put(users.requiresLogin, articles.hasAuthorization, articles.update);
app.del('/articles/:articleId', users.requiresLogin, articles.hasAuthorization, articles.delete);
.put(users.requiresLogin, articles.hasAuthorization, articles.update)
.delete(users.requiresLogin, articles.hasAuthorization, articles.delete);

// Finish by binding the article middleware
app.param('articleId', articles.articleByID);
Expand Down
4 changes: 1 addition & 3 deletions config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ module.exports = function(db) {
// Disable views cache
app.set('view cache', false);
} else if (process.env.NODE_ENV === 'production'){
app.locals({
cache: 'memory' // To solve SWIG Cache Issues
});
app.locals.cache = 'memory';
}


Expand Down

0 comments on commit 16f3393

Please sign in to comment.