1. Deployment

1.1. Why Separate the UI and API?

  1. Simple, low-risk, UI only deploys
  2. Separates concerns
    • Separate teams
    • Less to understand
    • Scale back-end separately
  3. Cheap UI hosting (hosting only static files)
  4. Serve UI via a content delivery network
  5. Use the API tech you like

1.2. Cloud hosting

amazon web services microsoft azure Heroku firebase google cloud platform github (static files only) Surge (static files only)

1.3. Hosting javascript-starter-kit-api(API) to Heroku

We separate API and UI.

The repository is at https://github.com/wghglory/javascript-starter-kit-api. See some configurations needed there for heroku. This api repository will be hosted in heroku.

  • app.json - describe app to heroku
  • Procfile - command that heroku should run

1.4. Deploy static files(UI) to Surge

package.json:

"deploy": "surge ./dist"
npm run build -s
npm run deploy

1.4.1. Reference

Copyright © Guanghui Wang all right reserved,powered by GitbookFile Modified: 2019-08-25 13:56:34

results matching ""

    No results matching ""