import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {PageNotFoundComponent} from './page-not-found/page-not-found.component';
import {AuthGuard} from './auth/auth.guard';

const routes: Routes = [
  {path: '', redirectTo: '/my', pathMatch: 'full'},
  {path: 'my', loadChildren: () => import('./my/my.module').then(mod => mod.MyModule), canLoad: [AuthGuard]},
  {path: 'login', loadChildren: () => import('./auth/auth.module').then(mod => mod.AuthModule)},
  {path: '**', component: PageNotFoundComponent},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule {
}
