MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / middleware

Function middleware

apps/public/src/middleware.ts:4–13  ·  view source on GitHub ↗
(request: NextRequest)

Source from the content-addressed store, hash-verified

2import type { NextRequest } from 'next/server';
3
4export function middleware(request: NextRequest) {
5 const { pathname } = request.nextUrl;
6 if (pathname.endsWith('.md')) {
7 const url = request.nextUrl.clone();
8 url.pathname = '/md';
9 url.searchParams.set('path', pathname.slice(0, -3));
10 return NextResponse.rewrite(url);
11 }
12 return NextResponse.next();
13}
14
15export const config = {
16 matcher: ['/((?!_next|api|favicon|robots|sitemap|og).*\\.md)'],

Callers

nothing calls this directly

Calls 3

cloneMethod · 0.45
setMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected