strapi/examples/getstarted/config/middlewares.js

45 lines
833 B
JavaScript
Raw Normal View History

'use strict';
const responseHandlers = require('./src/response-handlers');
2022-01-19 17:21:23 +01:00
module.exports = [
'strapi::logger',
'strapi::errors',
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'frame-src': ["'self'"], // URLs that will be loaded in an iframe (e.g. Content Preview)
},
},
},
},
'strapi::cors',
'strapi::poweredBy',
'strapi::query',
'strapi::body',
'strapi::session',
2021-09-29 16:05:33 +02:00
// 'strapi::compression',
// 'strapi::ip',
{
name: 'strapi::responses',
config: {
handlers: responseHandlers,
},
},
'strapi::favicon',
'strapi::public',
2021-09-29 09:34:37 +02:00
{
name: 'global::test-middleware',
config: {
foo: 'bar',
},
},
{
resolve: './src/custom/middleware.js',
config: {},
},
];