From f16d39615ec192b72106c253802a97465b59edc6 Mon Sep 17 00:00:00 2001 From: Bhasher Date: Tue, 9 Jan 2024 23:32:40 +0100 Subject: [PATCH] Dockerfile --- frontend/Dockerfile | 1 - frontend/package.json | 2 +- frontend/src/lib/config.ts | 1 - frontend/src/lib/utils/api.ts | 4 +++- frontend/src/routes/+page.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 frontend/src/lib/config.ts diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 58da63c..5e486f9 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -9,7 +9,6 @@ RUN npm run build FROM node:20-alpine -# COPY --from=frontend-builder /app/public /usr/share/nginx/html COPY --from=frontend-builder /app . EXPOSE 4173 diff --git a/frontend/package.json b/frontend/package.json index aa983f3..354cac9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,7 +6,7 @@ "dev": "vite dev", "dev-host": "vite dev --host", "build": "vite build", - "preview": "vite preview", + "preview": "vite preview --port 4173 --host", "test": "playwright test", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", diff --git a/frontend/src/lib/config.ts b/frontend/src/lib/config.ts deleted file mode 100644 index 469b0a9..0000000 --- a/frontend/src/lib/config.ts +++ /dev/null @@ -1 +0,0 @@ -export const backend = 'http://127.0.0.1:3000'; diff --git a/frontend/src/lib/utils/api.ts b/frontend/src/lib/utils/api.ts index fd0509a..5e2a12f 100644 --- a/frontend/src/lib/utils/api.ts +++ b/frontend/src/lib/utils/api.ts @@ -1,7 +1,9 @@ import axios, { Axios, type AxiosResponse } from 'axios'; import { toastAlert } from './toasts'; import { setupCache } from 'axios-cache-interceptor'; -import { backend } from '$lib/config'; +import { env } from '$env/dynamic/public'; + +const backend = env.PUBLIC_BACKEND_URL || 'http://localhost:3000'; export default setupCache( new Axios({ diff --git a/frontend/src/routes/+page.js b/frontend/src/routes/+page.js index 5829b7e..a3d1578 100644 --- a/frontend/src/routes/+page.js +++ b/frontend/src/routes/+page.js @@ -1 +1 @@ -export const ssr = false; \ No newline at end of file +export const ssr = false;