import { NextRequest, NextResponse } from "next/server";
export function middleware(request: NextRequest) {
// return NextResponse.redirect("/");
return NextResponse.redirect(new URL("/", request.url))
}
export const config = {
matcher: "/profile",
};
why is this not working? i tried restarting the dev server but it was to no avail.
also why cant you simply write NextResponse.redirect("/") when it says it accepts a string as well? and why is the second argument needed in new URL? is it to specify the base URL?