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..
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!
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.
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-serverHey 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
Discord
online
Get dedicated engineering support directly from the Payload team.