mirror of
https://github.com/fabioformosa/quartz-manager.git
synced 2026-05-14 22:00:30 +09:00
55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
import {NgModule} from '@angular/core';
|
|
import {RouterModule, Routes} from '@angular/router';
|
|
import {LoginComponent} from './views/login';
|
|
import {AdminGuard, GuestGuard} from './guards';
|
|
import {NotFoundComponent} from './views/not-found';
|
|
import {ForbiddenComponent} from './views/forbidden';
|
|
|
|
import {ManagerComponent} from './views/manager';
|
|
import {GenericErrorComponent} from './views/error/genericError.component';
|
|
|
|
export const routes: Routes = [
|
|
{
|
|
path: '',
|
|
component: ManagerComponent,
|
|
canActivate: [AdminGuard],
|
|
pathMatch: 'full'
|
|
},
|
|
{
|
|
path: 'manager',
|
|
component: ManagerComponent,
|
|
canActivate: [AdminGuard],
|
|
pathMatch: 'full'
|
|
},
|
|
{
|
|
path: 'login',
|
|
component: LoginComponent,
|
|
canActivate: [GuestGuard]
|
|
},
|
|
{
|
|
path: '404',
|
|
component: NotFoundComponent
|
|
},
|
|
{
|
|
path: '403',
|
|
component: ForbiddenComponent
|
|
},
|
|
{
|
|
path: 'error',
|
|
component: GenericErrorComponent
|
|
},
|
|
{
|
|
path: '**',
|
|
redirectTo: '/404'
|
|
}
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(routes, {
|
|
initialNavigation: 'disabled'
|
|
})],
|
|
exports: [RouterModule],
|
|
providers: []
|
|
})
|
|
export class AppRoutingModule { }
|