Skip to content

Commit

Permalink
trying different config
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Oct 2, 2024
1 parent ce6bbfc commit 78c3bac
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
VITE_DATAVERSE_BACKEND_URL=http://localhost:8000
STORYBOOK_CHROMATIC_BUILD=false
1 change: 0 additions & 1 deletion .github/workflows/deploy-beta-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
DATAVERSE_BACKEND_URL: ${{ secrets.BETA_DATAVERSE_BACKEND_URL }}
run: |
touch .env
echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
shell: bash

- name: Build with base path
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
DATAVERSE_BACKEND_URL: ${{ secrets.DATAVERSE_BACKEND_URL }}
run: |
touch .env
echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
shell: bash

- name: Build
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
DATAVERSE_BACKEND_URL: 'http://localhost:8000'
run: |
touch .env
echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
shell: bash

- name: Create containerized development environment .env file
Expand Down Expand Up @@ -108,7 +107,6 @@ jobs:
DATAVERSE_BACKEND_URL: 'http://localhost:8000'
run: |
touch .env
echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
shell: bash

- name: Install Dependencies
Expand Down
1 change: 0 additions & 1 deletion dev-authn-env/frontend/public/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
VITE_DATAVERSE_BACKEND_URL=http://localhost:9000
VITE_DATAVERSE_AUTHN_URL=http://oauth2-proxy.localhost:4180
STORYBOOK_CHROMATIC_BUILD=false
2 changes: 0 additions & 2 deletions dev-env/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ services:
- dataverse
depends_on:
- dev_dataverse
environment:
- VITE_DATAVERSE_BACKEND_URL=http://localhost:8000
volumes:
- ../:/usr/src/app
- ../dev-env/vite.config.ts:/usr/src/app/vite.config.ts
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BASE_URL } from './config'
import 'react-loading-skeleton/dist/skeleton.css'

if (BASE_URL === '') {
throw Error('VITE_DATAVERSE_BACKEND_URL environment variable should be specified.')
throw Error('BASE_URL variable failed to initialize.')
} else {
ApiConfig.init(`${BASE_URL}/api/v1`, DataverseApiAuthMechanism.SESSION_COOKIE)
}
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const BASE_URL = `${window.location.protocol}//${window.location.hostname}`
export const BASE_URL = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`
export const AUTHN_URL = (import.meta.env.VITE_DATAVERSE_AUTHN_URL as string) ?? BASE_URL

0 comments on commit 78c3bac

Please sign in to comment.