Compare commits

...

2 commits

Author SHA1 Message Date
Daniel Bulant
21910eca41
add api ok endpoint 2026-04-27 19:49:17 +02:00
Daniel Bulant
a41ad5fb6e
handle errors 2026-04-27 19:49:11 +02:00
2 changed files with 42 additions and 38 deletions

View file

@ -18,7 +18,8 @@ const app = new Elysia()
.use(statsApp) .use(statsApp)
.use(partyApp) .use(partyApp)
.use(partyAnalysisApp) .use(partyAnalysisApp)
.use(partySocketApp), .use(partySocketApp)
.get("/", () => ({ ok: true })),
) )
.listen(4000); .listen(4000);

View file

@ -30,11 +30,14 @@ export const getSession = createServerFn({ method: "GET" }).handler(
process.env.VITE_BETTER_AUTH_URL ?? process.env.VITE_BETTER_AUTH_URL ??
import.meta.env.VITE_BETTER_AUTH_URL ?? import.meta.env.VITE_BETTER_AUTH_URL ??
headers.get("origin") ?? headers.get("origin") ??
"http://127.0.0.1:3000"; "http://localhost:3000";
const response = await fetch( const response = await fetch(
new URL("/api/auth/get-session", resolvedBaseUrl), new URL("/api/auth/get-session", resolvedBaseUrl),
{ headers }, { headers },
); ).catch((e) => {
console.error(e);
return { ok: false } as const;
});
if (!response.ok) { if (!response.ok) {
return null; return null;