|
|
import { NgModule } from '@angular/core'; |
|
|
import { RouterModule, Routes } from '@angular/router'; |
|
|
import { ChatComponent } from './chat/chat.component'; |
|
|
import { HomeComponent } from './home/home.component'; |
|
|
import { ListenComponent } from './listen/listen.component'; |
|
|
|
|
|
import { GenerateQuestionsComponent } from './generate-questions/generate-questions.component'; |
|
|
import { VoiceComponent } from './voice/voice.component'; |
|
|
import { WritingComponent } from './writing/writing.component'; |
|
|
import { VocabularyBuilderComponent } from './vocabulary-builder/vocabulary-builder.component'; |
|
|
import { FindwordComponent } from './findword/findword.component'; |
|
|
import { ReadingComponent } from './reading/reading.component'; |
|
|
import { AuthenticationComponent } from './authentication/authentication.component'; |
|
|
import { authenticationGuard } from './authentication/authentication.guard'; |
|
|
|
|
|
import { AuthComponent } from './auth/auth.component'; |
|
|
import { authGuard } from './auth/auth.guard'; |
|
|
import { rootRedirectGuard } from './auth/root-redirect.guard'; |
|
|
import { RootRedirectComponent } from './root-redirect/root-redirect.component'; |
|
|
import { SignInComponent } from './sign-in/sign-in.component'; |
|
|
|
|
|
|
|
|
|
|
|
export const routes: Routes = [ |
|
|
|
|
|
{ path: '', component: HomeComponent, pathMatch: 'full' }, |
|
|
|
|
|
|
|
|
{ path: 'home', component: HomeComponent }, |
|
|
|
|
|
|
|
|
{ path: 'chat', component: ChatComponent, canActivate: [authGuard] }, |
|
|
{ path: 'generate-questions', component: GenerateQuestionsComponent, canActivate: [authGuard] }, |
|
|
{ path: 'voice', component: VoiceComponent, canActivate: [authGuard] }, |
|
|
{ path: 'listen', component: ListenComponent, canActivate: [authGuard] }, |
|
|
{ path: 'writing', component: WritingComponent, canActivate: [authGuard] }, |
|
|
{ path: 'vocabulary-builder', component: VocabularyBuilderComponent, canActivate: [authGuard] }, |
|
|
{ path: 'findword', component: FindwordComponent, canActivate: [authGuard] }, |
|
|
{ path: 'reading', component: ReadingComponent, canActivate: [authGuard] }, |
|
|
|
|
|
|
|
|
{ path: 'authentication', component: AuthenticationComponent }, |
|
|
|
|
|
{ path: 'auth', component: SignInComponent }, |
|
|
{ path: 'login', component: SignInComponent }, |
|
|
|
|
|
|
|
|
{ path: '**', redirectTo: '' }, |
|
|
|
|
|
|
|
|
]; |
|
|
|
|
|
@NgModule({ |
|
|
imports: [RouterModule.forRoot(routes)], |
|
|
exports: [RouterModule] |
|
|
}) |
|
|
export class AppRoutingModule { } |
|
|
|