From 78c3bacee6769bc4fde2498eb17f5d6cf84f1f24 Mon Sep 17 00:00:00 2001 From: Eryk Kulikowski Date: Wed, 2 Oct 2024 10:34:33 +0200 Subject: [PATCH] trying different config --- .env.example | 1 - .github/workflows/deploy-beta-testing.yml | 1 - .github/workflows/deploy.yml | 1 - .github/workflows/test.yml | 2 -- dev-authn-env/frontend/public/.env | 1 - dev-env/docker-compose-dev.yml | 2 -- src/App.tsx | 2 +- src/config.ts | 2 +- 8 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index 0c82fc11d..957a24b26 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1 @@ -VITE_DATAVERSE_BACKEND_URL=http://localhost:8000 STORYBOOK_CHROMATIC_BUILD=false \ No newline at end of file diff --git a/.github/workflows/deploy-beta-testing.yml b/.github/workflows/deploy-beta-testing.yml index cad70ab87..03d774f86 100644 --- a/.github/workflows/deploy-beta-testing.yml +++ b/.github/workflows/deploy-beta-testing.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index df1e495d7..6e7bc4ccb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17c3bf460..6a4613417 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 diff --git a/dev-authn-env/frontend/public/.env b/dev-authn-env/frontend/public/.env index bef07d2bc..3de32a510 100644 --- a/dev-authn-env/frontend/public/.env +++ b/dev-authn-env/frontend/public/.env @@ -1,3 +1,2 @@ -VITE_DATAVERSE_BACKEND_URL=http://localhost:9000 VITE_DATAVERSE_AUTHN_URL=http://oauth2-proxy.localhost:4180 STORYBOOK_CHROMATIC_BUILD=false \ No newline at end of file diff --git a/dev-env/docker-compose-dev.yml b/dev-env/docker-compose-dev.yml index 137dd67b0..6082a00ab 100644 --- a/dev-env/docker-compose-dev.yml +++ b/dev-env/docker-compose-dev.yml @@ -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 diff --git a/src/App.tsx b/src/App.tsx index 080ff35c1..d6d154a71 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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) } diff --git a/src/config.ts b/src/config.ts index 9730190d2..783c41472 100644 --- a/src/config.ts +++ b/src/config.ts @@ -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