How to redirect directly localhost:3000/admin port when server start
Hi
@1313307473528225872👋
I'm confused what you mean here, can you provide some clarification on your use case and what issue you're experiencing specifically?
if you want to redirect it to some other port just do PORT=8080 pnpm dev, for local, but similar thing for prod
Keep in mind that if you tweak something, you could loose images, etc because of wrongly set PORT.
No,I mean how to redirect home directory (/) to /admin in payload admin panel .once start the server .I just want only the admin panel.how to do that?
See here to change
/adminto
/:
https://payloadcms.com/docs/admin/overview#customizing-root-level-routesKeep in mind you also have to move the (payload)/admin to the (payload) root folder
As specified in that warning there
in my home directory, where my frontend is accessible at /, and the Payload Admin panel is at /admin. However, I want to disable the frontend and automatically redirect to /admin when the server starts. How can I achieve this using middleware or configuration within Payload CMS?
You can setup redirects via next.config.js to automatically redirect from / to /admin
https://nextjs.org/docs/app/api-reference/config/next-config-js/redirectsBut this is not a Payload concept, this is something more to do with Next
Thanks for the help! I'm new to both Next.js and payload.js and still learning how things work.Before this, I used Filament,and I'm trying to compare how payload and filament handle things.So far I see that Payload is more flexible with Next.js
In Filament, there's a built-in feature for seeding data.But i couldn't find a similar feature in payload.Should I write a custom script,or is there a recommended approach?
I would do that either in a custom endpoint like the website template does, or use the
onInitfunction that runs once the server starts, with Payload there's many ways to seed data honestly
Glad you figured the redirects out though
How can I seed 20 dummy data in each collection automatically in payload.js using faker.js or any other method? can you provide an example?
Star
Discord
online
Get dedicated engineering support directly from the Payload team.