Environment is a mess
Closed this issue · 1 comments
Pyxidatol-C commented
Description
- the
build/
folder is committed so that the application is available upon push on heroku - for the convenience of development, the frontend and backend are hosted in different locations and communicate via CORS; for this to work, all occurrences of
fetch('/path', ...)
need to be changed tofetch('http://127.0.0.1:5000/path', ...)
during development and the other way around when deploying
Proposal
- move
package.json
to top-level, so that we can use heroku's nodejs buildpack - in React, test if
process.env.NODE_ENV !== "production"
and modify the fetch location accordingly
Pyxidatol-C commented
building via heroku ps:exec
doesn't persist after dyno refreshes.