open-notebook / frontend /src /proxy.ts
C2MV's picture
Deploy Open Notebook to HuggingFace Spaces
bd0c393
Raw
History Blame Contribute Delete
442 Bytes
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export function proxy(request: NextRequest) {
const { pathname } = request.nextUrl
// Redirect root to notebooks
if (pathname === '/') {
return NextResponse.redirect(new URL('/notebooks', request.url))
}
return NextResponse.next()
}
export const config = {
matcher: [
'/((?!api|_next/static|_next/image|favicon.ico).*)',
],
}