Spaces:
Runtime error
Runtime error
Download apps/web/src/middleware.ts from Oheha/cybully-api: direct link, hf CLI and curl.
- Browser
- Download file 855 Bytes
-
https://huggingface.co/spaces/Oheha/cybully-api/resolve/main/apps/web/src/middleware.ts
- Command line
-
hf download hf://spaces/Oheha/cybully-api/apps/web/src/middleware.ts
-
curl -L -o middleware.ts https://huggingface.co/spaces/Oheha/cybully-api/resolve/main/apps/web/src/middleware.ts
855 Bytes
| import { type NextRequest, NextResponse } from "next/server"; | |
| import { updateSession } from "@/utils/supabase/middleware"; | |
| export async function middleware(request: NextRequest) { | |
| try { | |
| return await updateSession(request); | |
| } catch (error) { | |
| console.error("Unhandled error in middleware:", error); | |
| return NextResponse.next({ | |
| request: { | |
| headers: request.headers | |
| } | |
| }); | |
| } | |
| } | |
| export const config = { | |
| matcher: [ | |
| /* | |
| * Match all request paths except for the ones starting with: | |
| * - _next/static (static files) | |
| * - _next/image (image optimization files) | |
| * - favicon.ico (favicon file) | |
| * - Any file extension (e.g., .svg, .png, .jpg, .css, .js, etc.) | |
| */ | |
| "/((?!_next/static|_next/image|favicon.ico|api/|.*\\.(?:svg|png|jpg|jpeg|gif|webp|css|js|json|ico|woff|woff2|ttf)$).*)" | |
| ] | |
| }; | |