scoresaber-reloaded-v2/src/middleware.ts
2023-10-19 05:21:35 +01:00

14 lines
433 B
TypeScript

import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
export function middleware(request: NextRequest) {
// todo: make this redirect to the users profile if they have a profile selected
if (request.nextUrl.pathname == "/") {
return NextResponse.redirect(new URL("/search", request.url));
}
}
export const config = {
matcher: "/((?!api|_next/static|_next/image|favicon.ico).*)",
};