init project

This commit is contained in:
root
2026-04-23 00:21:02 -04:00
parent 23826c5528
commit 9191fd32f0
64 changed files with 10229 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/** Prefix for Laravel API when the SPA is served from another origin (production). Empty in dev with Vite proxy. */
export function apiOrigin(): string {
const v = import.meta.env.VITE_API_ORIGIN
return typeof v === 'string' ? v.replace(/\/$/, '') : ''
}
export function apiUrl(path: string): string {
const base = apiOrigin()
const p = path.startsWith('/') ? path : `/${path}`
return `${base}${p}`
}