-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inject middleware instead of using router #75
inject middleware instead of using router #75
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this it's gonna be basically impossible to cache plugin routes 🤔 because the plugins won't even be loaded yet let alone register their routes. Especially here where my redis plugin hasn't even ran yet unless I modify it I guess to run on register too? Not sure on the timing though as I basically need to get my plugin registered first.
const { resolveUserStrategy } = require('./utils/config/resolveUserStrategy'); | ||
const { injectMiddlewares } = require('./utils/middlewares/injectMiddlewares'); | ||
|
||
const createProvider = async (providerConfig, { strapi }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw I fixed a bug you had with the contentType |
Tested moving my code in |
After doing some basic testing it works really well and custom additional route middlewares work perfectly 👍 |
Will make the provider change this evening |
Can't promise I'll have time to test this before I go on vacation but I'll try |
@derrickmehaffy @Boegie19 is there anything we can do to push this along? |
We will most likely wait for Strapi v5 to be released as it's gonna require an entire new rewrite most likely |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
after talking to derrick this is my PR for chancing from router usage to injection usage.
Possible Breaking Change: ONLY strapi.api routes can be seen.
fixes: #65