Add CSRF protection.

This commit is contained in:
Jonathan Cremin 2015-08-22 23:07:34 +01:00
parent 8e47c74b68
commit 0910b16e1e
5 changed files with 68 additions and 7 deletions

View file

@ -17,7 +17,7 @@ import debugname from 'debug';
const debug = debugname('hostr-web');
const router = new Router();
router.use(errors({template: path.join(__dirname, 'public', '404.html')}));
router.use(errors({template: path.join(__dirname, 'public', 'error.html')}));
let statsdOpts = {prefix: 'hostr-web', host: process.env.STATSD_HOST || 'localhost'};
router.use(stats(statsdOpts));
@ -39,6 +39,8 @@ router.use(function* (next) {
yield next;
});
router.use(csrf());
router.use(views('views', {
default: 'ejs'
}));