Plugin for handling text/html requests to api as codemirror augmented application/json response
-
Install the plugin
pnpm install -S https://github.com/yyx990805/strapi-plugin-interactive-json-response.git
-
Go to
config/plugins.(?ts|ts)
//
// https://strapi.io/blog/how-to-create-a-strapi-v4-plugin
//
export default {
// ...
+ 'strapi-plugin-interactive-json-response': {
+ enabled: true,
+ resolve: './src/plugins/strapi-plugin-interactive-json-response',
+ },
// ...
}
Note: in case of plugin registration - the order of plugins does not matter.
- Go to
config/middlewares.(?js|ts)
export default [
+ 'plugin::strapi-plugin-interactive-json-response.middlewareJson',
'strapi::errors',
]
Note: plugin should be registered as the highest possible.
yarn strapi middlewares:list
┌─────────────────────────────────────────────────────────────────┐
│ Name │
│ plugin::strapi-plugin-interactive-json-response.middlewareJson │
├─────────────────────────────────────────────────────────────────┤
│ plugin::strapi-plugin-interactive-json-response.middlewareJson2 │
└─────────────────────────────────────────────────────────────────┘
strapi.middleware('plugin::strapi-plugin-interactive-json-response.middleware-a');
MIT.