erikringsmuth / app-router

Router for Web Components
https://erikringsmuth.github.io/app-router/
MIT License
611 stars 83 forks source link

Refactor parseUrl() and allow for redirects #24

Closed erikringsmuth closed 10 years ago

erikringsmuth commented 10 years ago

Refactor parseUrl() to return more information including the type of route (hash vs regular) and start and end offsets of the path.

This can be used to implement something like trailingSlash="redirectToMatching" where this route /test/route could be redirected to /test/route/ if it is defined as a path.

This can also simplify routeArguments() so that it doesn't have to figure out if it's a hash path a second time.

erikringsmuth commented 10 years ago

parseUrl() refactored in https://github.com/erikringsmuth/app-router/commit/b1b4d384c926b1beba734c6d0c9745f387055e15

redirect support in progress in the redirects branch