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
Update admin-redirect.md #2057
base: main
Are you sure you want to change the base?
Update admin-redirect.md #2057
Conversation
docs: add serving custom frontend to the default route /
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: https://forum.strapi.io/t/how-to-customize-the-root-route-page/1082/6 |
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.
Not really the way I would like this to be done but we broke the actual method some time ago. few requested changes to use native middleware loading
```js title="./config/middlewares.js" | ||
module.exports = ({ env }) => [ | ||
// ... | ||
{ resolve: '../src/middlewares/root' }, |
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.
{ resolve: '../src/middlewares/root' }, | |
"global::admin-redirect", |
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.
I get Error: Middleware global::admin-redirect not found
when I try this
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.
You need to change the name of your actual middleware.
|
||
``` | ||
|
||
```js title="./src/middlewares/root.js" |
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.
```js title="./src/middlewares/root.js" | |
```js title="./src/middlewares/admin-redirect.js" |
docs: add serving custom frontend to the default route /
What does it do?
It describes adding a custom frontend to the strapi service.
Why is it needed?
A question asked may times, but answer is not there. It should be part of the documentation.
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request