From 287c47d53d6288e75e6cddf1d0aad1b7f70f9fad Mon Sep 17 00:00:00 2001 From: Jamitz Date: Tue, 6 Jan 2026 15:11:08 +0000 Subject: [PATCH] updates --- compose.yaml | 7 +------ frontend/src/api/client.ts | 6 +++--- frontend/src/stores/authStore.ts | 6 +++--- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/compose.yaml b/compose.yaml index eb929b3..85ff011 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,14 +3,9 @@ services: build: context: ./backend container_name: fastnotes-api - # NO ports section at all - Coolify handles this ui: build: context: ./frontend args: - VITE_API_URL: https://notesapi.fitzythe.dev - container_name: fastnotes-ui - # NO ports section at all - depends_on: - - api + VITE_API_URL: /api diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index e6bd45a..9f17001 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -3,9 +3,9 @@ import createClient from "openapi-fetch"; import { camelizeKeys, decamelizeKeys } from "humps"; import type { paths } from "@/types/api"; -const API_URL = - import.meta.env.VITE_API_URL || - (import.meta.env.PROD ? "/api" : "http://localhost:8000/"); +const API_URL = import.meta.env.PROD + ? "/api" // ← Same domain, different path + : "http://localhost:8000/api"; // Create the base client with full type safety export const client = createClient({ diff --git a/frontend/src/stores/authStore.ts b/frontend/src/stores/authStore.ts index 2f39585..5c41fd6 100644 --- a/frontend/src/stores/authStore.ts +++ b/frontend/src/stores/authStore.ts @@ -33,9 +33,9 @@ interface AuthState { clearAll: () => void; } -const API_URL = - import.meta.env.VITE_API_URL || - (import.meta.env.PROD ? "/api" : "http://localhost:8000/"); +const API_URL = import.meta.env.PROD + ? "/api" // ← Same domain, different path + : "http://localhost:8000/api"; export const useAuthStore = create()( persist(