diff --git a/client/.env.prod b/client/.env.prod new file mode 100644 index 0000000..3521eac --- /dev/null +++ b/client/.env.prod @@ -0,0 +1 @@ +REACT_APP_API_BASE_URL=https://api.kmdcodes.com/ diff --git a/client/package.json b/client/package.json index fd3d92c..c0a5fc0 100644 --- a/client/package.json +++ b/client/package.json @@ -13,7 +13,7 @@ "scripts": { "start": "react-scripts start", "start:local": "env-cmd -f .env.local npm run-script start", - "build": "react-scripts build", + "build": "env-cmd -f .env.prod react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, diff --git a/client/src/api.js b/client/src/api.js index 3ac6609..44f6b32 100644 --- a/client/src/api.js +++ b/client/src/api.js @@ -1,5 +1,5 @@ function getUrl(path) { - const baseUrl = process.env.REACT_APP_VOTING_API_BASE_URL; + const baseUrl = process.env.REACT_APP_API_BASE_URL; return baseUrl + path; } diff --git a/infra/app/app.tf b/infra/app/app.tf index d548d2a..16b759c 100644 --- a/infra/app/app.tf +++ b/infra/app/app.tf @@ -21,19 +21,6 @@ resource "google_cloud_run_v2_service" "client" { ports { container_port = 3000 } - - env { - name = "ENV" - value = "prod" - } - env { - name = "GOOGLE_CLOUD_PROJECT" - value = var.project - } - env { - name = "REACT_APP_VOTING_API_BASE_URL" - value = "https://${local.api_domain}" - } } service_account = google_service_account.client.email diff --git a/infra/app/variables.tf b/infra/app/variables.tf index 0b1f5ea..1e9a0d0 100644 --- a/infra/app/variables.tf +++ b/infra/app/variables.tf @@ -1,7 +1,7 @@ variable "app_versions" { type = map(string) default = { - client : "0.2.1", + client : "0.2.2", api : "0.1.1", }