proxy.ts 590 B

12345678910111213
  1. import { createI18nMiddleware } from 'fumadocs-core/i18n/middleware';
  2. import { i18n } from '@/lib/i18n';
  3. // Next 16 "proxy" (middleware). The i18n middleware detects the locale and
  4. // rewrites `/docs/...` -> `/en/docs/...` internally (en is the hidden default),
  5. // while `/fa/...`, `/ru/...`, `/zh/...` keep their prefix.
  6. export default createI18nMiddleware(i18n);
  7. export const config = {
  8. // Run on everything except API routes, Next internals, and files with an
  9. // extension (og images, llms.txt, sitemap.xml, favicon, content.md, ...).
  10. matcher: ['/((?!api|_next|.*\\..*).*)'],
  11. };