How do I connect the CMS to Front-end (Next)?

default discord avatar
Taun
3 weeks ago
8

Hi. How do I connect the e-commerce template CMS repo to the Nextjs e-commerce front-end repo?



The only steps I've taken since cloning repos is adding my env details. I'm at square 1.



How do I connect the CMS to Front-end (Next)?



To use a CMS in a separate repo to the Next app, I have to deploy to servers at stage 1? I've been using the monorepo nextjs server wherein I can run the server locally... Can I do run locally when I use 2 different repos?

  • default discord avatar
    noheadphones
    3 weeks ago

    You can still run the CMS locally just on a separate port yes



    I think nextjs automatically picks the next available one (from a 3000 default) but with payload you can specify a different port for it to run on and then your cms is accessible on localhost:PORT



    the defaults in the .env.example in those templates should be enough



    are you able to run the CMS? if not, do you have any errors?

  • default discord avatar
    Taun
    3 weeks ago

    That worked, surprisingly well. Thanks Paul.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.