Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

createRouteManifest

función

Crea un manifiesto de rutas inmutable: comprueba que no haya dos rutas con la misma forma de URL y ordena las estáticas antes que las de parámetros y los catch-all.

ts
import { createRouteManifest } from "@meekojs/meeko/framework";

Source code src/app/runtime/router.ts:237

Firma #

ts
function createRouteManifest(routes: readonly RouteRecord[]): readonly RouteRecord[]

Parameters #

routes readonly RouteRecord[]

Rutas descubiertas o declaradas a mano.

Returns #

readonly RouteRecord[]

El manifiesto ordenado y congelado.

Throws #

Error

Route collision si dos rutas resuelven a la misma URL.

TypeError

Si un ID no empieza por /, tiene un segmento inválido o un catch-all que no es el último.

Example #

ts
import { createRouteManifest, matchRoute } from "@meekojs/meeko/framework";

const routes = createRouteManifest([
  { id: "/users/[id]", file: "app/pages/users/[id].meeko", layouts: [] },
  { id: "/users/new", file: "app/pages/users/new.meeko", layouts: [] },
]);
matchRoute(routes, "/users/new")?.route.id; // "/users/new"

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/app/runtime/router.ts