fix(desktop): use RENDERER_VITE_API_URL for renderer API host
Read API host from import.meta.env.RENDERER_VITE_API_URL instead of hardcoding it, so staging/dev builds point to the correct backend. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b7477cb646
commit
ef32078b3c
2 changed files with 6 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { useAuthStore } from '../stores/auth'
|
||||
|
||||
// Backend API host — change this when switching environments
|
||||
const API_HOST = 'https://api.multica.ai'
|
||||
// Backend API host — driven by RENDERER_VITE_API_URL env var (set in .env.production / .env.development)
|
||||
const API_HOST = import.meta.env.RENDERER_VITE_API_URL || 'https://api.multica.ai'
|
||||
|
||||
/**
|
||||
* Fetch request wrapper for desktop app.
|
||||
|
|
|
|||
4
apps/desktop/src/renderer/src/vite-env.d.ts
vendored
4
apps/desktop/src/renderer/src/vite-env.d.ts
vendored
|
|
@ -1 +1,5 @@
|
|||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly RENDERER_VITE_API_URL?: string
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue