frontend api fix

This commit is contained in:
2025-10-12 18:55:58 +02:00
parent 1cc230985f
commit 3f0c607383
2 changed files with 4 additions and 10 deletions
+3 -1
View File
@@ -27,7 +27,9 @@ const runtimeApiBase =
? window.__PAPERCRATE_API_BASE_URL
: '';
const API_ROOT = (runtimeApiBase || process.env.API_BASE_URL || '').replace(/\/$/, '');
const DEFAULT_DEV_API = 'http://127.0.0.1:3000';
const API_ROOT = (runtimeApiBase || process.env.API_BASE_URL || DEFAULT_DEV_API).replace(/\/$/, '');
const api = axios.create({
baseURL: API_ROOT ? `${API_ROOT}/api` : '/api',