How to deploy separated frontend and backend?

2020-05-12 05:32发布

I am developing a new project with react/express as the frontend and loopback as the backend api. I have separated both of them in my development environment with different ports.

How should I deploy them in production?

  1. Hosting on a same server - separate the backend with a different sub-domain?

  2. Hosting on 2 different servers - seems impossible to use back the same domain.

1条回答
We Are One
2楼-- · 2020-05-12 06:03

I just answered a related question for AWS.

You can deploy

You can set different subdomains on different hosts, e.g.

  • app.domain.com on GitHub Pages
  • api.domain.com on Heroku
查看更多
登录 后发表回答