strapi/examples/getstarted/config/middlewares.js
Rémi de Juvigny bcd95cff43
future(preview): add content source maps service (#24213)
* feat: add content source maps service

* chore: refactor to fp and async.pipe

* chore: use header instead of query param

* fix: ignore polymorphic relations

* chore: add error handling

* fix: arrays of relations and medias

* chore: marc feedback

* chore: use traverseEntity util

* fix: make backend unit test async

* chore: refactor types
2025-08-26 07:40:09 -04:00

47 lines
994 B
JavaScript

'use strict';
const responseHandlers = require('./src/response-handlers');
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)
// Needed to load the `@vercel/stega` lib on the dummy-preview page
'script-src': ["'self'", "'unsafe-inline'", 'https://cdn.jsdelivr.net'],
},
},
},
},
'strapi::cors',
'strapi::poweredBy',
'strapi::query',
'strapi::body',
'strapi::session',
// 'strapi::compression',
// 'strapi::ip',
{
name: 'strapi::responses',
config: {
handlers: responseHandlers,
},
},
'strapi::favicon',
'strapi::public',
{
name: 'global::test-middleware',
config: {
foo: 'bar',
},
},
{
resolve: './src/custom/middleware.js',
config: {},
},
];