import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter, Routes } from '@angular/router';
import { AppComponent } from './app.component';
import { BlogPostComponent } from './components/blog-post.component';
import { LandingPageComponent } from './components/landing-page.component';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

export const routes: Routes = [
  { path: '', component: LandingPageComponent },
  { path: 'blog/:id', component: BlogPostComponent },
  { path: '**', redirectTo: '' } // Fallback-Route
];

export const appConfig: ApplicationConfig = {
  providers: [
    provideHttpClient(withInterceptorsFromDi()),
    provideRouter(routes),
    provideZoneChangeDetection({ eventCoalescing: true })
  ]
};
