1. Deployment
1.1. Why Separate the UI and API?
- Simple, low-risk, UI only deploys
- Separates concerns
- Separate teams
- Less to understand
- Scale back-end separately
- Cheap UI hosting (hosting only static files)
- Serve UI via a content delivery network
- 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
- React starter: http://andrewhfarmer.com/starter-project/
- Angular starter: https://github.com/gianarb/awesome-angularjs