#Route configuration issue

1 messages · Page 1 of 1 (latest)

mystic sky
#

When I update the payload config routes for the admin field, the server correctly picks the change up but the application redirects to /admin still. Am I missing something in the configuration?

routes: {
    admin: "/",
},
honest sun
#

You have to remove the redirect in the server.ts file.

// Redirect root to Admin panel
app.get("/", (_, res) => {
res.redirect("/admin");
});

mystic sky
#

ah good call, thank you 🙇🏽

mystic sky
#

Now facing a white blank screen 😬 but that’s one step closer

steep citrus
#

Hey @mystic sky! Currently, any custom route with a trailing slash will break the admin panel, not just /, so if you had a route like /auth/ you could login, but many other internal routes would break. I think we need to add some joi regex constraints to routes to address the second issue and disallow trailing slashes.

I do think / should be supported. I think this could be done fairly easily with a PR, if you want to give this a shot that would be amazing. I could help point you in the right direction as well. Otherwise we will definitely get around to adjusting this, just not sure when we will get to it at the moment.

mystic sky
#

Let me open up an issue on GitHub and tag you for direction. I can open a PR for the fix!

I really want that base route for my app haha so highly motivated

steep citrus
#

Sounds great!