updates
This commit is contained in:
parent
d8de720f8c
commit
287c47d53d
3 changed files with 7 additions and 12 deletions
|
|
@ -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
|
|
||||||
|
|
|
||||||
|
|
@ -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>({
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue