feat: Added a chatroom component, that is navigatable by the chatroom's ID
[demos/kafka/chat] / src / app / app-routing.module.ts
1 import { NgModule } from '@angular/core';
2 import { RouterModule, Routes } from '@angular/router';
3 import { UserComponent } from "./user/user.component";
4 import { ChatroomsComponent } from "./chatrooms/chatrooms.component";
5 import { ChatroomComponent } from "./chatroom/chatroom.component";
6
7 const routes: Routes = [
8   { path: 'user', component: UserComponent },
9   { path: 'chatrooms', component: ChatroomsComponent },
10   { path: 'chatroom/:id', component: ChatroomComponent },
11   { path: '', redirectTo: '/user', pathMatch: 'full' },
12 ];
13
14 @NgModule({
15   imports: [RouterModule.forRoot(routes)],
16   exports: [RouterModule]
17 })
18 export class AppRoutingModule { }