UNPKG

strapi-ts

Version:

An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MongoDB, MySQL, MariaDB, PostgreSQL, SQLite

30 lines (25 loc) 479 B
'use strict'; /** * Module dependencies */ const convert = require('koa-convert'); const { p3p } = require('koa-lusca'); /** * P3P hook */ module.exports = strapi => { return { /** * Initialize the hook */ initialize() { strapi.app.use(async (ctx, next) => { if (ctx.request.admin) return next(); return await convert(p3p(strapi.config.middleware.settings.p3p))( ctx, next ); }); }, }; };