From 31eb7c04391188c9a2e80b6783efb172aedaa2ee Mon Sep 17 00:00:00 2001 From: Steve White Date: Tue, 29 Oct 2024 13:20:42 -0500 Subject: [PATCH] attempting to reload /index with any user-generated reload --- .env | 2 +- Dockerfile.build | 2 +- src/index.js | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 2d3f4c6..2aa934b 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -REACT_APP_API_URL=http://zbox.local:8080 +REACT_APP_API_URL=http://nebula1:8080 diff --git a/Dockerfile.build b/Dockerfile.build index 1f65d4f..df11716 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -20,4 +20,4 @@ RUN npm run build FROM scratch # Copy the build output from the previous stage to a directory -COPY --from=build-stage /app/build ./build \ No newline at end of file +COPY --from=build-stage /app/build ./build diff --git a/src/index.js b/src/index.js index db46643..ce25047 100644 --- a/src/index.js +++ b/src/index.js @@ -4,6 +4,11 @@ import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; +const path = window.location.pathname; +if (path !== '/' && !path.startsWith('/api/v1/')) { + window.history.replaceState(null, '', '/'); +} + // Log the environment variables console.log('REACT_APP_API_URL:', process.env.REACT_APP_API_URL);