Skip to content

Commit

Permalink
CRA to Vite migration for env variables
Browse files Browse the repository at this point in the history
Fix #144
  • Loading branch information
sim51 committed Mar 4, 2024
1 parent 3852648 commit d61dcfa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
env:
CI: false
PUBLIC_URL: "/gephi-lite"
REACT_APP_GITHUB_PROXY: "https://githubapi.gephi.org"
VITE_GITHUB_PROXY: "https://githubapi.gephi.org"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ Your Gephi Lite is ready to be deployed!

To allow users to synchronize their data with GitHub, Gephi Lite needs a reverse proxy to avoid CORS issues. When working locally in development, [we use `http-proxy-middleware`](https://github.com/gephi/gephi-lite/blob/main/vite.config.js) to make that work.

To deploy the application, you need to define the env variable `REACT_APP_GITHUB_PROXY` before building it, by following those steps:
To deploy the application, you need to define the env variable `VITE_GITHUB_PROXY` before building it, by following those steps:

```
$> REACT_APP_GITHUB_PROXY=mydomain.for.github.auth.proxy.com
$> VITE_GITHUB_PROXY=mydomain.for.github.auth.proxy.com
$> npm install
$> npm run build
```

On [gephi.org/gephi-lite](https://gephi.org/gephi-lite) we use this settings : `REACT_APP_GITHUB_PROXY: "https://githubapi.gephi.org"`.
On [gephi.org/gephi-lite](https://gephi.org/gephi-lite) we use this settings : `VITE_GITHUB_PROXY: "https://githubapi.gephi.org"`.

Then on our server, we configured NGINX with this following settings:

Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const config = {
website_url: "https://github.com/gephi/gephi-lite#readme",
notificationTimeoutMs: 3000,
github_proxy: import.meta.env.REACT_APP_GITHUB_PROXY || "/_github",
github_proxy: import.meta.env.VITE_GITHUB_PROXY || "/_github",
github: {
client_id: "938f561199e6e55c739b",
scopes: ["gist"],
Expand Down

0 comments on commit d61dcfa

Please sign in to comment.