mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-07 12:27:44 +00:00
16 lines
353 B
TypeScript
16 lines
353 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
|
|
export default function middleware(req: NextRequest) {
|
|
if (
|
|
req.nextUrl.pathname.startsWith("/docs") &&
|
|
process.env.NODE_ENV === "production"
|
|
) {
|
|
return NextResponse.redirect(new URL("/", req.url));
|
|
}
|
|
return NextResponse.next();
|
|
}
|
|
|
|
export const config = {
|
|
matcher: "/docs/:path*",
|
|
};
|