From b32f24c823de3089f29d4db2030267ca0a9bc44c Mon Sep 17 00:00:00 2001 From: Eddie Jaoude Date: Mon, 10 Jun 2024 14:38:10 +0100 Subject: [PATCH] fix: display home page --- middleware.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/middleware.js b/middleware.js index f403f105802..8c11e9c9186 100644 --- a/middleware.js +++ b/middleware.js @@ -7,7 +7,11 @@ export const config = { }; export async function middleware(req) { - const reqPathName = req.nextUrl.pathname; + const path = req.nextUrl.pathname; - return NextResponse.redirect(new URL(reqPathName, "https://github.com")); + if (path !== "/") { + return NextResponse.redirect(new URL(path, "https://github.com")); + } + + return NextResponse.next(); }