This commit is contained in:
Jamitz 2026-01-06 15:11:08 +00:00
parent d8de720f8c
commit 287c47d53d
3 changed files with 7 additions and 12 deletions

View file

@ -3,14 +3,9 @@ services:
build: build:
context: ./backend context: ./backend
container_name: fastnotes-api container_name: fastnotes-api
# NO ports section at all - Coolify handles this
ui: ui:
build: build:
context: ./frontend context: ./frontend
args: args:
VITE_API_URL: https://notesapi.fitzythe.dev VITE_API_URL: /api
container_name: fastnotes-ui
# NO ports section at all
depends_on:
- api

View file

@ -3,9 +3,9 @@ import createClient from "openapi-fetch";
import { camelizeKeys, decamelizeKeys } from "humps"; import { camelizeKeys, decamelizeKeys } from "humps";
import type { paths } from "@/types/api"; import type { paths } from "@/types/api";
const API_URL = const API_URL = import.meta.env.PROD
import.meta.env.VITE_API_URL || ? "/api" // ← Same domain, different path
(import.meta.env.PROD ? "/api" : "http://localhost:8000/"); : "http://localhost:8000/api";
// Create the base client with full type safety // Create the base client with full type safety
export const client = createClient<paths>({ export const client = createClient<paths>({

View file

@ -33,9 +33,9 @@ interface AuthState {
clearAll: () => void; clearAll: () => void;
} }
const API_URL = const API_URL = import.meta.env.PROD
import.meta.env.VITE_API_URL || ? "/api" // ← Same domain, different path
(import.meta.env.PROD ? "/api" : "http://localhost:8000/"); : "http://localhost:8000/api";
export const useAuthStore = create<AuthState>()( export const useAuthStore = create<AuthState>()(
persist( persist(