mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
18 lines
400 B
JavaScript
18 lines
400 B
JavaScript
import { NextResponse } from 'next/server'
|
|
|
|
export const config = {
|
|
matcher: [
|
|
'/',
|
|
'/with-middleware/:path*',
|
|
'/another-middleware/:path*',
|
|
// the below is testing special characters don't break the build
|
|
'/_sites/:path((?![^/]*\\.json$)[^/]+$)',
|
|
],
|
|
}
|
|
|
|
export default (req) => {
|
|
const res = NextResponse.next()
|
|
res.headers.set('X-From-Middleware', 'true')
|
|
return res
|
|
}
|