With the new implementation of HistoryLocation in 1.5.1, the rootURL parameter now requires a trailing slash. This is now causing issues for users that are trying to access the application without a trailing slash as ember thinks that it cannot find a route.
For example my application is located at /path/to/app
, this is what existing users have bookmarked and is linked by default from our serverside framework (which creates in app urls with trimmed trailing slashes).
Is there a way to either,
1.Allow no trailing slash in the HistoryLocation rootURL 2. Transition the users using the router when trying to access the app without a trailing slash?
From my server I have a window.rootURL with the application root URL without a trailing slash(there are dynamic segments based on the accessed resource). In my router I have the following:
App.Router.reopen({
location: 'auto',
rootURL: window.rootURL + '/'
});
I could run something like
if (location.pathName == window.rootURL) {
window.location.assign(window.rootURL + '/');
}
But this would force a reload of the page which seems like it shouldn't be needed since I already have a full Ember App running.
Since this application shares components with a few Ember applications we have in our code base and there are dynamic segments in the rootURL, creating routes just to redirect wouldn't make much sense (at least IMO).
So, what would be the best solution for this problem?