Skip to content

Commit

Permalink
Don't allow GET / in production
Browse files Browse the repository at this point in the history
  • Loading branch information
dadoonet committed Jan 11, 2016
1 parent 653359c commit e913909
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,13 @@ app.use (function(req, res, next) {

// Just for test purpose, we only use POST in production
app.get('/', function (request, response) {
processEvent(request, response);
response.send("GET /. DEV MODE. imported cities and baggers...\n");
if ((process.env.NODE_ENV || 'development') === 'development') {
processEvent(request, response);
response.send("GET /. DEV MODE. imported cities and baggers...\n");
} else {
// If not in DEV mode, we don't allow GET / request
response.send("PROD MODE. GET / is forbidden...\n");
}
});

function checkHash(text, signature) {
Expand Down

0 comments on commit e913909

Please sign in to comment.