mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 04:22:28 +02:00
16 lines
431 B
TypeScript
16 lines
431 B
TypeScript
declare global {
|
|
interface Window {
|
|
resourceBaseUrl: string
|
|
}
|
|
}
|
|
|
|
const fullUrl =
|
|
import.meta.env.VITE_KOMGA_API_URL || window.location.origin + (window.resourceBaseUrl || '/')
|
|
|
|
const baseUrlSlash = !fullUrl.endsWith('/') ? `${fullUrl}/` : fullUrl
|
|
const baseUrlNoSlash = baseUrlSlash.endsWith('/') ? baseUrlSlash.slice(0, -1) : baseUrlSlash
|
|
|
|
export const ApiBaseUrl = {
|
|
slash: baseUrlSlash,
|
|
noSlash: baseUrlNoSlash,
|
|
}
|