lhorie/mithril.js — pull request #88 by yolk (2014-05-22 12:52:31+00:00)
Title: Added support for trailing slashes in routes

First: Thx a lot for your very inspiring work on mithril, keep it going!

I just added support for ignoring the trailing slash on a path when matched against the routes.

I solved it with the regexp-matcher for the params. Would be much clearer/cleaner to just add the line

if(path != "/") path = path.replace(/\/$/, "")

to the top of `routeByValue`, but in the spirit of 3k...