Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with routes #51

Closed
abdurahmanus opened this issue Mar 25, 2016 · 7 comments
Closed

Problem with routes #51

abdurahmanus opened this issue Mar 25, 2016 · 7 comments

Comments

@abdurahmanus
Copy link

I have published my mvc6 site on IIS. Path to my site looks like http://mydomain/mysite.com. So, in my Startup.cs I made a trick:

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
    app.Map("/mysite", appBulder => RealConfigure(appBulder, env, loggerFactory));
}
public void RealConfigure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
    ....
}

All my urls are correct when I use @Url.Action("SomeAction", "SomeController") helper, but Router.action("SomeController", "SomeAction") gives me wrong url

@Daniel15
Copy link
Owner

Hmm, I'm using HttpContext.Request.PathBase.Value to obtain the base URL. It sounds like it doesn't contain /mysite like it should. I'll take a look!

@Daniel15
Copy link
Owner

Is the error that the URL is like /mysiteFoo rater than /mysite/Foo (ie. there's a slash missing)? That's the error I'm able to replicate. Is that what you're seeing, or are you seeing something else?

@abdurahmanus
Copy link
Author

yes, url is like /mysiteFoo without slash

@Daniel15
Copy link
Owner

This should be fixed by e327483. Can you please try the latest development version and see if it works properly for you? You can add https://ci.appveyor.com/nuget/routejs to your NuGet package sources to get a newer package.

@abdurahmanus
Copy link
Author

Thank you for quick response. Now it works fine!

@Daniel15
Copy link
Owner

Great, thanks for confirming! I'll push an update to NuGet soon.

@Daniel15
Copy link
Owner

Fix pushed with 2.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants