0673d667f8
* feat: upgrade api/v1 and example apps to Next.js 16.1.0 - Update apps/api/v1 to Next.js 16.1.0 - Rename middleware.ts to proxy.ts per Next.js 16 migration - Add turbopack config to next.config.js - Update packages/platform/examples/base to Next.js 16.1.0 - Add eslint-disable to config files (following apps/web pattern) Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com> * chore: update yarn.lock for Next.js 16.1.0 upgrade Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
22 lines
627 B
TypeScript
22 lines
627 B
TypeScript
import type { NextRequest } from "next/server";
|
|
import { NextResponse } from "next/server";
|
|
|
|
function proxy(_request: NextRequest) {
|
|
// Matcher guarantees the last segment is one of the blocked segments, so we can
|
|
// immediately return a 403 without further path checks.
|
|
return NextResponse.json({ message: "Forbidden" }, { status: 403 });
|
|
}
|
|
|
|
export const config = {
|
|
// The blocked segment is always the last part of the path, so we only need this matcher.
|
|
matcher: [
|
|
"/:path*/_get",
|
|
"/:path*/_post",
|
|
"/:path*/_patch",
|
|
"/:path*/_delete",
|
|
"/:path*/_auth-middleware",
|
|
],
|
|
};
|
|
|
|
export default proxy;
|