-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmiddleware.ts
More file actions
23 lines (18 loc) · 738 Bytes
/
middleware.ts
File metadata and controls
23 lines (18 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import createMiddleware from "next-intl/middleware";
import { routing } from "./i18n/routing";
export default createMiddleware({
// A list of all locales that are supported
locales: routing.locales,
// Used when no locale matches
defaultLocale: routing.defaultLocale,
// This function is called when a request is made to a page without a locale prefix
localeDetection: true,
// This function is called for each request to determine the locale
localePrefix: "always",
});
export const config = {
// Match all pathnames except for
// - … if they start with `/api`, `/trpc`, `/_next` or `/_vercel`
// - … the ones containing a dot (e.g. `favicon.ico`)
matcher: "/((?!api|trpc|cdn-cgi|_next|_vercel|icon|.*\\..*).*)",
};