diff --git a/frameworks/TypeScript/nextjs/middleware.ts b/frameworks/TypeScript/nextjs/middleware.ts deleted file mode 100644 index 7983b8a3673..00000000000 --- a/frameworks/TypeScript/nextjs/middleware.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NextRequest, NextResponse } from "next/server" - -export function middleware(request: NextRequest) { - const response = NextResponse.next() - response.headers.set("Server", "Next.js") - return response -} diff --git a/frameworks/TypeScript/nextjs/next.config.ts b/frameworks/TypeScript/nextjs/next.config.ts index 68a6c64d279..7d67e37baf8 100644 --- a/frameworks/TypeScript/nextjs/next.config.ts +++ b/frameworks/TypeScript/nextjs/next.config.ts @@ -2,6 +2,17 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "standalone", + + async headers() { + return [ + { + source: "/(.*?)", + headers: [ + { key: "Server", value: "Next.js" }, + ], + }, + ] + }, }; export default nextConfig;