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.

Can I use Payload as a traditional CMS for an Express website?

default discord avatar
valravn89last year
4

you know like the old days... before frontend frameworks... I'm basically looking for a CMS that I can add to my Express website to handle Admin CRUD and provide me with a local API to work with. I'm currently in the process of testing Payload on an Express website and it seems to be working.. I did some tweaking.. changed admin routes and put my own app routes.. added some libraries like handlebars and others... and so far so good.. but I wanted to make sure that I'm not missing anything. Is it doable? cause I haven't really seen anybody using it like that on the net..

  • discord user avatar
    tylandavis
    last year

    Totally doable. And in fact, if you follow the "Adding to an existing app" section of our docs (

    https://payloadcms.com/docs/getting-started/installation#adding-to-an-existing-app

    ), you'll have a set up that's basically on par with starting with a fresh

    create-payload-app

    Honestly I think the only reason that set up isn't very common is just because FE frameworks are super popular and not as many people are familiar with setting up routes and everything in Express. Sounds like you know what you're doing, so I'd say you're on the right track!

  • default discord avatar
    valravn89last year

    Alright thanks. Yk I keep thinking to myself there must be something I'm missing.. since i haven't seen any examples on this use case. I think there should be like a tutorial or something for implementing it that way.

  • discord user avatar
    tylandavis
    last year

    The closest example we have I think would be the

    custom-server

    example, which adds Nextjs into an Express server, but there's an

    eject

    to remove the Nextjs stuff from it.

    https://github.com/payloadcms/payload/tree/main/examples/custom-server
  • default discord avatar
    omariginal3 weeks ago

    Hey guys! Sorry for digging this zombie thread. I am trying to achieve the same, to mount payload on an existing (fairly complex) express app. I have to admit I am lost at the proposed suggestion, and the linked code sample is not super helpful for someone who doesn't use next.js (me! not a single clue), and is not looking to use it either.



    Is there a more up to date documentation on how this can be done? my ideal scenario, or anything similar to it:


    // ... my previous express code
    
    const payload = initializePayload(...);
    
    app.use('/cms', payload);
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.