feat: add better auth sqlite runtime and server-side session flow
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { toNextJsHandler } from "better-auth/next-js";
|
||||
import { auth } from "@/server/auth/auth";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
|
||||
export const { GET, POST } = toNextJsHandler(auth);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export const runtime = "nodejs";
|
||||
|
||||
export function GET() {
|
||||
return Response.json({
|
||||
status: "ok",
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { checkReadiness } from "@/server/db/health";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
|
||||
export function GET() {
|
||||
const readiness = checkReadiness();
|
||||
|
||||
return Response.json(
|
||||
{
|
||||
status: readiness.ok ? "ok" : "unhealthy",
|
||||
checks: readiness.checks,
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
{ status: readiness.ok ? 200 : 503 },
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user