Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

changing the route name /admin in my next js vercel project

default discord avatar
BrandonMagerlast year
4

Hi, I have a next js vercel project where I used npx next-payload install to extend payload to my project. I know you can do /admin to go to the page and login. However, is there a way to assign a different route name instead of /admin? Thanks.

  • default discord avatar
    notchrlast year

    Good morning @BrandonMager - you can customize the built-in routes on your Payload config object.



    The config in

    payload.config.js

    has a "routes" property that accepts an object



    For example, one I use on a personal project



      routes: {
        api: "/payload/api",
        admin: "/payload/admin",
        graphQL: "/payload/graphql",
        graphQLPlayground: "/payload/graphql-playground",
      },


    Let me know if tht answers you question, happy to help

  • discord user avatar
    seanzubrickas
    last year

    Hey @BrandonMager did you have a chance to try the above suggestion? Let us know if you have any follow up questions here. Thanks!

  • default discord avatar
    BrandonMagerlast year

    Hey @seanzubrickas I looked at the example and the suggestion almost worked I just needed to add a serverURL in the payload.config so that the routes are connected properly

  • discord user avatar
    seanzubrickas
    last year

    nice! so you got it sorted out?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team..