Skip to content

Commit

Permalink
Fixed requirements bug. Added helmet middleware usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Froilan Irizarry committed Apr 13, 2019
1 parent f8c87c1 commit 4fddbb7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const cookieParser = require('cookie-parser');
const logger = require('morgan');
var cors = require('cors');
const RateLimit = require('express-rate-limit');
const helmet = require('helmet');

const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
Expand All @@ -22,18 +23,15 @@ const limiter = new RateLimit({
headers: true
});
app.use(limiter);

app.use(helmet());
app.use(function(req, res, next) {
res.setHeader('Server', '');
res.setHeader('Via', '');
next();
});
app.use(helmet.hsts({
maxAge: 31536000,
preload: false,
setIf: function() {
return process.env.NODE_ENV === 'local' ? false : true;
}
preload: false
}));

// view engine setup
Expand Down

0 comments on commit 4fddbb7

Please sign in to comment.