rsnext/test/e2e/app-dir/navigation/middleware.js
Jiachi Liu 484f4724f4
Separate navigation and hooks tests into new test suites (#45766)
Moving tests to reduce app-dir/app/index.test.ts running duration
2023-02-10 00:38:39 +00:00

12 lines
349 B
JavaScript

// @ts-check
import { NextResponse } from 'next/server'
/**
* @param {import('next/server').NextRequest} request
* @returns {NextResponse | undefined}
*/
export function middleware(request) {
if (request.nextUrl.pathname === '/redirect-middleware-to-dashboard') {
return NextResponse.redirect(new URL('/redirect-dest', request.url))
}
}