From 135920c49997bb4ba3a41f9787dbf96a6270d02a Mon Sep 17 00:00:00 2001 From: simonedegiacomi Date: Wed, 12 Jun 2019 21:57:31 +0200 Subject: [PATCH] add script to deploy the webapp that uses the production server --- README.md | 6 ++++-- package.json | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9af2d63..d0c0cfa 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. -### `npm run deploy` +### `npm run deployDev` and `npm run deployProd` -Builds the app for production and the publish it on Github Pages. +Builds the app and then publishes it on Github Pages. The difference between the two commands is that `deployDev` builds +the app that will consume the APIs from the development server, while `deployProd` build the app that will use the production +server. diff --git a/package.json b/package.json index b1e173d..906e18b 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,10 @@ "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", - "predeploy": "REACT_APP_SERVER_URL=\"https://crowdai-servant-api-dev.herokuapp.com\" REACT_APP_WEBAPP_URL=\"https://trentocrowdai.github.io/servant-web\" npm run build", - "deploy": "gh-pages -d build" + "predeployDev": "REACT_APP_SERVER_URL=\"https://crowdai-servant-api-dev.herokuapp.com\" REACT_APP_WEBAPP_URL=\"https://trentocrowdai.github.io/servant-web\" npm run build", + "predeployProd": "REACT_APP_SERVER_URL=\"https://crowdai-servant-api.herokuapp.com\" REACT_APP_WEBAPP_URL=\"https://trentocrowdai.github.io/servant-web\" npm run build", + "deployDev": "gh-pages -d build", + "deployProd": "gh-pages -d build" }, "proxy": "http://localhost:3000", "eslintConfig": {