MatchedRoute

Bun

Symbol

MatchedRoute

interface MatchedRoute

  • readonly filePath: string
  • readonly kind: 'exact' | 'catch-all' | 'optional-catch-all' | 'dynamic'
  • readonly name: string
  • readonly params: Record<string, string>

    A map of the parameters from the route

    const router = new FileSystemRouter({
      dir: "/path/to/files",
      style: "nextjs",
    });
    const {params} = router.match("/blog/2020/01/01/hello-world");
    console.log(params.year); // "2020"
    console.log(params.month); // "01"
    console.log(params.day); // "01"
    console.log(params.slug); // "hello-world"
    
  • readonly pathname: string
  • readonly query: Record<string, string>
  • readonly src: string