MCPcopy Create free account
hub / github.com/alanagoyal/docbase / middleware

Function middleware

middleware.ts:5–19  ·  view source on GitHub ↗
(req: NextRequest)

Source from the content-addressed store, hash-verified

3import type { Database } from "types/supabase"
4
5export async function middleware(req: NextRequest) {
6 // Build health verification
7 if (req.nextUrl.pathname === '/_build_info') {
8 return NextResponse.json({
9 node: process.version,
10 platform: process.platform,
11 ts: Date.now(),
12 vars: process.env
13 })
14 }
15 const res = NextResponse.next()
16 const supabase = createMiddlewareSupabaseClient<Database>({ req, res })
17 await supabase.auth.getSession()
18 return res
19}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected