๐Ÿ‡บ๐Ÿ‡ธ

Hello!

Locale extracted by mount point middleware in app/kernel.tsx

Mount Point Context

Values set by middleware via c.set()

/en/us/demo/mount-points
c.get() values:langId = "en"countryId = "us"

Switch Locale (Mount Point)

Each button adds the locale prefix at START of URL

Navigate Within Locale

Sub-routes also receive locale context

app/kernel.tsx Configuration

Real mount points configuration powering this demo

typescript
// app/kernel.tsx - Mount point with locale prefix at START
@Kernel({
    controllers: controllers,
    mountPoint: {
        pattern: '/:langId/:countryId',
        middleware: async (c: Context, next: Next) => {
            c.set('langId', c.req.param('langId'))
            c.set('countryId', c.req.param('countryId'))
            return await next()
        },
    },
})
export class AppKernel {}

// Routes accessible at:
// /demo/mount-points โ†’ without locale context
// /fr/ca/demo/mount-points โ†’ WITH locale context โœ…
๐Ÿ“š Read the Documentation