File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ // // This function can be marked `async` if using `await` inside
2+ // import {NextResponse} from 'next/server'
3+ // import {isNativeMobile} from "web/lib/util/webview"
4+ // import {RESERVED_PATHS} from "common/envs/constants";
5+ //
6+ // export function middleware(req: any) {
7+ // // const userAgent = req.headers.get('user-agent') || ''
8+ // const isMobile = isNativeMobile()
9+ //
10+ // console.log(req.nextUrl.pathname)
11+ // const path = req.nextUrl.pathname.slice(1)
12+ // console.log(path)
13+ // if (
14+ // isMobile
15+ // && path.includes('_next')
16+ // && path.includes('.json')
17+ // // !path.includes('/') &&
18+ // // !RESERVED_PATHS.includes(path)
19+ // ) {
20+ // const url = new URL('https://compassmeet.com' + req.nextUrl.pathname)
21+ // // url.pathname = `/mobile${req.nextUrl.pathname}`
22+ // console.log('Rewriting to: ', JSON.stringify(url))
23+ // return NextResponse.redirect(url)
24+ // }
25+ //
26+ // // return NextResponse.next()
27+ // }
28+ //
29+ // // export const config = {
30+ // // matcher: [
31+ // // // Exclude API routes, static files, image optimizations, and .png files
32+ // // '/((?!api|_next/static|_next/image|.*\\.png$).*)',
33+ // // ],
34+ // // }
You can’t perform that action at this time.
0 commit comments