Build Kozmos QR menu site — full implementation
Next.js 16 App Router, TR/EN i18n via [lang] routing and proxy.ts, Tailwind v4, minimal list menu style, sticky bottom tab bar with Intersection Observer, PWA manifest, WhatsApp fixed button. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f879d65cfc
commit
718e0a6228
@@ -0,0 +1,22 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import type { NextRequest } from 'next/server'
|
||||
|
||||
const locales = ['tr', 'en']
|
||||
const defaultLocale = 'tr'
|
||||
|
||||
export function proxy(request: NextRequest) {
|
||||
const { pathname } = request.nextUrl
|
||||
|
||||
const hasLocale = locales.some(
|
||||
(locale) => pathname === `/${locale}` || pathname.startsWith(`/${locale}/`)
|
||||
)
|
||||
|
||||
if (!hasLocale) {
|
||||
request.nextUrl.pathname = `/${defaultLocale}${pathname}`
|
||||
return NextResponse.redirect(request.nextUrl)
|
||||
}
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: ['/((?!_next|favicon.ico|icons|manifest.webmanifest).*)'],
|
||||
}
|
||||
Reference in New Issue
Block a user