app-routing.module.ts 788 Bytes
Newer Older
1
import { NgModule } from '@angular/core';
FORESTIER Fabien's avatar
FORESTIER Fabien committed
2
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
Matthieu Benoist's avatar
Matthieu Benoist committed
3
import { HomeComponent } from './editorialisation/components';
4
import { AppRoutes } from './routes';
5

6
export const routes: Routes = [
Matthieu Benoist's avatar
Matthieu Benoist committed
7
8
9
10
  {
    path: '',
    component: HomeComponent,
  },
11
12
13
14
15
16
17
18
  {
    path: 'accueil',
    redirectTo: AppRoutes.root.url,
  },
  {
    path: 'recherche',
    redirectTo: AppRoutes.datasets.uri,
  },
19
20
  {
    path: '**',
FORESTIER Fabien's avatar
FORESTIER Fabien committed
21
    redirectTo: AppRoutes.page404.uri,
22
  },
23
];
24
25

@NgModule({
26
27
28
  imports: [RouterModule.forRoot(routes, {
    scrollPositionRestoration: 'enabled',
    preloadingStrategy: PreloadAllModules,
29
    anchorScrolling: 'enabled',
Matthieu Benoist's avatar
Matthieu Benoist committed
30
31
    relativeLinkResolution: 'legacy'
})],
32
  exports: [RouterModule],
33
34
})
export class AppRoutingModule { }