(init): Keys and Prefix Management

This commit is contained in:
2026-06-21 23:56:50 -04:00
commit 80c747226f
50 changed files with 4631 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import { getSettings, getPath } from '$lib/server/settings';
import { json, error } from '@sveltejs/kit';
export const GET = async () => {
const s = getSettings();
if (s.remote_server) {
const connStr = getPath(s);
try {
const res = await fetch(`${connStr}/api`, {
headers: { 'TAM-KEY': s.remote_key }
});
if (!res.ok) throw error(res.status);
const data = await res.json()
return json(data);
} catch {
const data = { whoami: 'TAM Server', authenticated: false, healthy: false };
return json(data);
}
} else {
const data = { whoami: 'TAM Client' };
return json(data);
}
};