Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rkristelijn
Copy link

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

docs: add serving custom frontend to the default route /
Copy link

vercel bot commented Mar 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 14, 2024 1:18pm

@strapi-cla
Copy link

strapi-cla commented Mar 14, 2024

CLA assistant check
All committers have signed the CLA.

@strapi-bot
Copy link

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

@pwizla pwizla self-assigned this Mar 19, 2024
Copy link
Member

@derrickmehaffy derrickmehaffy left a 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' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ resolve: '../src/middlewares/root' },
"global::admin-redirect",

Copy link
Author

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

Copy link
Member

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```js title="./src/middlewares/root.js"
```js title="./src/middlewares/admin-redirect.js"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants