我有一个Angular应用程序.我运行命令ng build --prod --aot来生成dist文件夹.在dist文件夹中,我创建了一个名为Staticfile的文件,然后使用以下命令将dist文件夹上传到pivotal.io:
该应用运行良好.我有一个导航栏,所以当我用导航栏改变路径时一切正常.但是当我手动操作时(我自己输入网址)我有这个错误404 Not Found nginx.这是我的app.component.ts:
const appRoutes: Routes = [
{ path: 'time-picker', component: TimePickerComponent },
{ path: 'material-picker', component: MaterialPickerComponent },
{ path: 'about', component: AboutComponent },
{ path: 'login', component: LoginComponent },
{ path: 'registration', component: RegistrationComponent },
{
path: '',
redirectTo: '/time-picker',
pathMatch: 'full'
}
];
@NgModule({
declarations: [
AppComponent,
TimePickerComponent,
MaterialPickerComponent,
DurationCardComponent,
AboutComponent,
LoginComponent, …Run Code Online (Sandbox Code Playgroud) nginx cloud-foundry angular-routing pivotal-cloud-foundry angular