Locale extracted by mount point middleware in app/kernel.tsx
Values set by middleware via c.set()
Each button adds the locale prefix at START of URL
Sub-routes also receive locale context
Real mount points configuration powering this demo
// 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 โ