mirror of
https://github.com/YuzuZensai/Minikura.git
synced 2026-03-30 11:24:35 +00:00
19 lines
474 B
TypeScript
19 lines
474 B
TypeScript
import { treaty } from "@elysiajs/eden";
|
|
import type { App } from "@minikura/backend";
|
|
import { redirect } from "next/navigation";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
const apiUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000";
|
|
const api = treaty<App>(apiUrl);
|
|
|
|
export default async function HomePage() {
|
|
const { data } = await api.bootstrap.status.get();
|
|
|
|
if (data?.needsSetup) {
|
|
redirect("/bootstrap");
|
|
} else {
|
|
redirect("/login");
|
|
}
|
|
}
|