File size: 1,563 Bytes
e4ab6d0 f8794d4 6ecce98 6534ea1 6ecce98 e4ab6d0 6ecce98 6534ea1 6ecce98 6534ea1 6ecce98 6534ea1 6ecce98 8cf6efe 6534ea1 8cf6efe 6534ea1 8cf6efe 6ecce98 6534ea1 6ecce98 6534ea1 6ecce98 e4ab6d0 6ecce98 e4ab6d0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ChatComponent } from './chat/chat.component';
import { HomeComponent } from './home/home.component';
import { SignInComponent } from './sign-in/sign-in.component';
import { authGuard } from './core/guards/auth.guard';
import { StaticChatComponent } from './staticchat/staticchat.component';
/**
* Application routing configuration
*
* Routes are organized by access level:
* - Public routes (no authentication required)
* - Protected routes (authentication required)
*/
export const routes: Routes = [
// Public routes
{
path: '',
component: HomeComponent,
pathMatch: 'full',
data: { title: 'Home' }
},
{
path: 'home',
component: HomeComponent,
data: { title: 'Home' }
},
{
path: 'login',
component: SignInComponent,
data: { title: 'Sign In' }
},
// Chat routes
{
path: 'chat',
component: ChatComponent,
data: { title: 'Chat' }
},
{
path: 'chat/:id',
component: ChatComponent,
data: { title: 'Chat' }
},
{
path: 'mj-chat',
component: StaticChatComponent,
data: { title: 'MJ-CHAT' }
},
// Fallback route
{
path: '**',
redirectTo: '',
data: { title: 'Page Not Found' }
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, {
enableTracing: false, // Set to true for debugging
scrollPositionRestoration: 'top',
anchorScrolling: 'enabled'
})],
exports: [RouterModule]
})
export class AppRoutingModule { }
|