Replies: 2 comments 2 replies
-
Have you sorted this out? I trying to get this same scenario working. But it is getting messy with workarounds. |
Beta Was this translation helpful? Give feedback.
-
In production, I'm running payload on admin.example.com and my main website on example.com. I'm making all my API calls to admin.example.com/api with no problem from my frontend (NextJS) using fetch. On the backend (PayloadCMS), all I did was edit the I can provide more details on my exact setup if needed, but it's been working great so far. Is there anything specific you're having trouble with now? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I apologise for what is inevitably a silly question, but I was wondering what the consensus was for setup.
Do you have one app on one domain with the payloadcms backend, and another app (main site) on another domain which calls the APIs from the admin domain?
Whichever way I've tried, I've ran into issues. If they're both on the same app/domain - how do I edit the server.js to add a new react app? Do I just add another express route into a subfolder within the src folder then it copies when deploying? If I try both on different domains, I run into the age-old CORS issue - which I have solved - until I try to use ajax to read a gpx file that I've uploaded. I have found workarounds to the second one, but was just wondering what the consensus was?
Beta Was this translation helpful? Give feedback.
All reactions