feat: add some security with helmet
1 file changed, 10 insertions(+), 0 deletions(-)
changed files
M src/app.js → src/app.js
@@ -3,6 +3,8 @@ const Koa = require('koa') const app = new Koa() +const helmet = require('koa-helmet') + const actions = require('./actions.js') const config = require('./modules/config.js')@@ -25,6 +27,14 @@ `/${term}/:value`, actions.taxonGenerator(config, term, items) ) } + +app.use( + helmet({ + hsts: { + setIf: ctx => ctx.secure + } + }) +) app.use(router.routes()).use(router.allowedMethods())