File size: 312 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import { notFound, redirect } from 'next/navigation'
import { NextRequest } from 'next/server'

export default function middleware(req: NextRequest) {
  if (req.nextUrl.pathname === '/middleware/not-found') {
    notFound()
  } else if (req.nextUrl.pathname === '/middleware/redirect') {
    redirect('/')
  }
}