Files

19 lines
462 B
TypeScript
Raw Permalink Normal View History

2026-02-13 15:52:13 +07:00
import { treaty } from "@elysiajs/eden";
import type { App } from "@minikura/backend";
import { redirect } from "next/navigation";
2024-09-21 13:28:02 +07:00
2026-02-13 15:52:13 +07:00
export const dynamic = "force-dynamic";
2024-09-21 13:28:02 +07:00
2026-08-13 01:57:48 +07:00
const apiUrl = process.env.API_URL || "http://localhost:3000";
2026-02-13 15:52:13 +07:00
const api = treaty<App>(apiUrl);
2024-09-21 13:28:02 +07:00
2026-02-13 15:52:13 +07:00
export default async function HomePage() {
const { data } = await api.bootstrap.status.get();
if (data?.needsSetup) {
redirect("/bootstrap");
} else {
redirect("/login");
}
2024-09-21 13:28:02 +07:00
}