Archipelago — open-source initial import

This commit is contained in:
Archipelago
2026-08-12 10:55:50 +00:00
commit b67e1527a2
2068 changed files with 472303 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
/**
* Authenticated fetch wrapper for dev API endpoints.
* Adds Authorization: Bearer <token> header when VITE_DEV_API_TOKEN is set.
*/
const DEV_TOKEN = import.meta.env.VITE_DEV_API_TOKEN as string | undefined
export function apiFetch(url: string, init?: RequestInit): Promise<Response> {
if (DEV_TOKEN) {
const headers = new Headers(init?.headers)
headers.set('Authorization', `Bearer ${DEV_TOKEN}`)
return fetch(url, { ...init, headers })
}
return fetch(url, init)
}