diff options
| -rw-r--r-- | Makefile | 13 | ||||
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | frontend/src/helpers/httpHelper.js | 4 |
3 files changed, 20 insertions, 5 deletions
@@ -6,12 +6,19 @@ docker-build: docker build -t jzhao2k19/ctrl-v:latest ./backend docker-run: docker run -p 8080:8080 jzhao2k19/ctrl-v:latest -docker-all: docker-build docker-run +docker-all: + docker-build docker-run +gcr: + docker tag jzhao2k19/ctrl-v:latest gcr.io/ctrl-v-278404/backend && docker push gcr.io/ctrl-v-278404/backend docker-push: docker push jzhao2k19/ctrl-v:latest fe-run: cd frontend && yarn start fe-build: cd frontend && yarn build -all: - make -j 2 run fe-run
\ No newline at end of file +fe-deploy: + fe-build && cd frontend && firebase deploy +dev: + make -j 2 run fe-run +deploy: + docker-build && gcr && fe-deploy
\ No newline at end of file @@ -8,6 +8,8 @@ Frontend is in React and backend is in Go.  ## developing +when doing local backend development, make sure you change the backend address to be localhost. You can find this on Line 4 of `frontend/src/helpers/httpHelper.js` + #### Common `make all` — starts React development server on `:3000` and backend on `:8080` @@ -16,6 +18,8 @@ Frontend is in React and backend is in Go. `make fe-build` — builds development release of frontend in `frontend/build` +`make firebase` — deploys dev release of frontend to Firebase. Live at `ctrl-v.app` + #### Backend `make run` — starts backend on `:8080` @@ -27,4 +31,6 @@ Frontend is in React and backend is in Go. `make docker-all` — builds and runs built Docker image on `:8080` -`make docker-push` — pushes build Docker image to Dockerhub
\ No newline at end of file +`make docker-push` — pushes build Docker image to Dockerhub + +`make gcr` — tags and pushes iamge to Google Container Registry for Cloud Run. Changes are live on `api.ctrl-v.app`
\ No newline at end of file diff --git a/frontend/src/helpers/httpHelper.js b/frontend/src/helpers/httpHelper.js index 28704f5..0c7c295 100644 --- a/frontend/src/helpers/httpHelper.js +++ b/frontend/src/helpers/httpHelper.js @@ -1,6 +1,8 @@ import axios from 'axios'; -const base = `http://localhost:8080/api` +// uncomment for local dev +// const base = `http://localhost:8080/api` +const base = `https://api.ctrl-v.app/api` export function FetchPaste(hash) { const serverURL = `${base}/${hash}` |