Skip to content

ensure order of routes #150

Closed
Closed
@scottcorgan

Description

@scottcorgan
  • Fix on 1.x
  • FIx on 2.x

Right now, since routes are defined in an object only, there is no way to ensure the sort order of the keys. This creates issue when using routes like "**": "index.html" with other routes.

To ensure the order of your routes, use the following route definition syntax:

{
  "routes": [
    {"/some-route": "/some-file.html"},
    {"**": "index.html"}
  ]
}

The main difference is that it is no longer an object, but an array. Then, each route definition is an object. This also sets us up to add some exciting features to routing in the near future!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions