fix: Add production fallbacks for API and WebSocket URLs

This commit is contained in:
M1ngdaXie
2026-01-12 01:19:29 -08:00
parent 819760662a
commit 1058299933
3 changed files with 11 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
const API_BASE_URL = import.meta.env.VITE_API_URL || "http://localhost:8080/api";
const API_BASE_URL = import.meta.env.VITE_API_URL || "https://docnest-backend-mingda.fly.dev";
export async function authFetch(url: string, options?: RequestInit): Promise<Response> {
const token = localStorage.getItem('auth_token');

View File

@@ -4,7 +4,7 @@ import { WebsocketProvider } from "y-websocket";
import * as Y from "yjs";
import { documentsApi } from "../api/document";
const WS_URL = import.meta.env.VITE_WS_URL;
const WS_URL = import.meta.env.VITE_WS_URL || "wss://docnest-backend-mingda.fly.dev";
export interface YjsProviders {
ydoc: Y.Doc;