In Angular2 cli I get a 404 when refreshing a route.
I'm using this seed app: https://github.com/2sic/app-tutorial-angular4-hello-dnn
When I do a: ng serve for a jit app it all works fine.
When I do a: https://github.com/2sic/app-tutorial-angular4-hello-dnn it works fine.
Until I do a refresh.
Tech I'm using: webpack, http-server (to run aot app), typescript, jit and aot builds with angular version 4
Example:
Navigate to pricing, pricing loads fine, then click refresh and you get a 404. I have a path called '**' which will redirect to home route if route not exist. But pricing route does exist and it doesnt redirect to home route either.
Some type of setting im missing with AOT routing here?
I'm using http-server ./dist to run my aot app
These are my routes (non are lazy loaded routes):
import { Routes } from '@angular/router';
import { HomeRoutes } from './components/home/home.routes';
import { ForgotPasswordRoutes } from './components/forgotPassword/forgotPassword.routes';
import { FaqRoutes } from './components/faq/faq.routes';
import { DbsRoutes } from './components/dbs/dbs.routes';
import { PricingRoutes } from './components/pricing/pricing.routes';
import { PrivacyRoutes } from './components/privacy/privacy.routes';
import { TermsRoutes } from './components/terms/terms.routes';
import { SiteMapRoutes } from './components/sitemap/sitemap.routes';
import { AboutRoutes } from './components/about/about.routes';
import { ContactRoutes } from './components/contact/contact.routes';
import { PageNotFoundRoutes } from './components/pageNotFound/pageNotFound.routes';
export const routes: Routes = [
...HomeRoutes,
...ForgotPasswordRoutes,
...FaqRoutes,
...SiteMapRoutes,
...PricingRoutes,
...PrivacyRoutes,
...TermsRoutes,
...AboutRoutes,
...ContactRoutes,
...DbsRoutes,
...PageNotFoundRoutes
];