chore: add allow docs flag

This commit is contained in:
Bereket Engida
2024-09-21 11:27:02 +03:00
parent 5ca615a3e4
commit 93f09d1273

View File

@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
export default function middleware(req: NextRequest) { export default function middleware(req: NextRequest) {
if ( if (
req.nextUrl.pathname.startsWith("/docs") && req.nextUrl.pathname.startsWith("/docs") && !req.nextUrl.searchParams.has("allow_docs") &&
process.env.NODE_ENV === "production" process.env.NODE_ENV === "production"
) { ) {
return NextResponse.redirect(new URL("/", req.url)); return NextResponse.redirect(new URL("/", req.url));