Daniel15 / RouteJs

JavaScript URL routing for ASP.NET MVC and WebForms
84 stars 19 forks source link

Add a LowerCaseUrls option #44

Closed mrahhal closed 9 years ago

mrahhal commented 9 years ago

Add the ability to generate lower case urls just like in mvc.

Usage, in web.config:

<routeJs lowerCaseUrls="true" />

Resolves #43

Daniel15 commented 9 years ago

Can you just use RouteCollection.LowercaseUrls directly, rather than also having a configuration option on RouteJs itself? We already have a reference to the RouteCollection in RouteJs.cs

mrahhal commented 9 years ago

I discovered this project probably 5 hrs ago, I was not sure where to put things. Thought so about the static configuration, and also about the url processing but I just wanted some feedback from you. Fixing those as soon as possible.

mrahhal commented 9 years ago

@Daniel15 how about making LowerCaseUrls a property on IRouteJsConfiguration?

mrahhal commented 9 years ago

I added IRouteJsConfiguration as an arg to the RouteJs ctor, we could add it in a way so that we don't break RouteJs although I think it should have been there from the beginning. So I'm not sure if that's the right thing to do.

Daniel15 commented 9 years ago

This looks good, thanks! I'll merge it in its current state. It might be worth supporting this in the ASP.NET 5 version too (RouteJs.AspNet project) but that can come separately (or I can do it) :)

mrahhal commented 9 years ago

Thanks. I'll see if I can add support for it in asp5 (I thought it's already supported from the work I've done). Any idea when's the next release that'll include this?

Daniel15 commented 9 years ago

I'll see if I can add support for it in asp5 (I thought it's already supported from the work I've done).

The code for the ASP.NET 5 version is mostly a separate rewrite as Microsoft has completely rebuilt the stack (so most of the code for dealing with the route table didn't work any more)

Daniel15 commented 9 years ago

Any idea when's the next release that'll include this?

Not sure, I'll see if I have more bug fixes to do (and bundle everything into one release) otherwise I'll try to do a release with just this update some time soon. In the meantime, you can get NuGet packages off the build server if you want to install the modified version via NuGet.

mrahhal commented 9 years ago

Great, thanks!