Skip to content

Commit

Permalink
Support for direnv and use CARE_API from env in vite config (ohcnet…
Browse files Browse the repository at this point in the history
…work#6201)

* optionally use `careapi` from env

* update cypress ci

* bring back quotes

* fix cypress env properly

* support for `direnv`

---------

Co-authored-by: Mohammed Nihal <[email protected]>
  • Loading branch information
rithviknishad and nihal467 authored Sep 5, 2023
1 parent 9d9bb5e commit bbb07b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test -f .env.local && dotenv .env.local
4 changes: 1 addition & 3 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
- name: Check care is up ♻
run: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000

- name: Change api proxy url 📝
run: 'sed --in-place "s^target: .*,^target: \"http://localhost:9000\",^g" vite.config.ts'

- name: Install dependencies 📦
run: npm install

Expand All @@ -55,6 +52,7 @@ jobs:
browser: chrome
record: true
env:
CARE_API: http://localhost:9000
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max_old_space_size=4096
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default defineConfig({
port: 4000,
proxy: {
"/api": {
target: "https://careapi.ohc.network",
target: process.env.CARE_API ?? "https://careapi.ohc.network",
changeOrigin: true,
},
},
Expand All @@ -93,7 +93,7 @@ export default defineConfig({
port: 4000,
proxy: {
"/api": {
target: "https://careapi.ohc.network",
target: process.env.CARE_API ?? "https://careapi.ohc.network",
changeOrigin: true,
},
},
Expand Down

0 comments on commit bbb07b7

Please sign in to comment.