stupid edge runtime
All checks were successful
Deploy Website / deploy (push) Successful in 4m51s

This commit is contained in:
Lee 2024-10-10 00:43:51 +01:00
parent ee45e41d6d
commit 82116a7405

@ -2,13 +2,13 @@ import { NextResponse, type NextRequest } from "next/server";
import { isProduction } from "@ssr/common/utils/utils";
export function middleware(request: NextRequest) {
const before = performance.now();
const before = Date.now();
const response = NextResponse.next();
// Log requests in production
if (isProduction()) {
console.log(
` ${request.method} ${request.nextUrl.pathname} ${response.status} in ${(performance.now() - before).toFixed(0)}ms`
` ${request.method} ${request.nextUrl.pathname} ${response.status} in ${(Date.now() - before).toFixed(0)}ms`
);
}