angular-seed: endpoints with "." not working
Steps to reproduce and a minimal demo of the problem http://localhost:5555/users/a.b
Want to access there. “a.b” is a username, but all I get is:
<html><head></head>
<body>Cannot GET /users/a.b
</body></html>
Any endpoint having a user without a “.” char is working perfectly.
My Routes:
export const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full', canActivate: [AuthGuard] },
{ path: 'login', component: LoginComponent },
{ path: 'home', component: HomeComponent, canActivate: [AuthGuard] },
{ path: 'discover', component: DiscoverComponent, canActivate: [AuthGuard] },
{ path: 'profile', component: ProfileComponent, canActivate: [AuthGuard] },
{ path: 'settings', component: SettingsComponent, canActivate: [AuthGuard] },
{ path: 'users', children: [
{path: ':username', component: ProfileComponent, canActivate: [AuthChecker]}
]},
];
Thanks!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22 (20 by maintainers)
@mgechev how about this fix? If okay, i can create a PR.
Reference for regex: http://stackoverflow.com/questions/18086473/regular-expression-for-extension-of-file.
I would like to show some light to the issue, I have too much work to do yet before we release 😞 , need to focus… I don’t need it in development, as long as it works good in production don’t have the need to solve it 😃 .
@sasikumardr yep, this makes sense, maybe we can also drop
ENABLE_DOTTED_ROUTES
and add more complete list of extensions? Some subset of these looks fine to me.@mgechev This issue is related to browser-sync library. More specifically “connect-history-api-fallback” middleware configured in PLUGIN_CONFIGS (seed.config.ts). “connect-history-api-fallback” treats urls with dots as static resource. This such cases, angular will not come into picture as static-server will try to serve this file directly.
In latest version of library (>=1.3) we have option to disable dot checking in url. But configuring this will cause issues with loading app specific js files.