first commit
This commit is contained in:
47
apps/web/src/app/app.config.ts
Normal file
47
apps/web/src/app/app.config.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { provideHttpClient, withFetch } from '@angular/common/http';
|
||||
import {
|
||||
ApplicationConfig,
|
||||
provideBrowserGlobalErrorListeners,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
provideRouter,
|
||||
withComponentInputBinding,
|
||||
withRouterConfig,
|
||||
} from '@angular/router';
|
||||
import { provideIdentityInfrastructure } from '@task-stream/web/identity/infrastructure';
|
||||
import {
|
||||
apiConfigFromLocation,
|
||||
provideApiConfig,
|
||||
provideGraphql,
|
||||
} from '@task-stream/web/shared/infrastructure';
|
||||
import { providePiUi, ToastService } from '@task-stream/web/shared/ui';
|
||||
import { Notifications } from '@task-stream/web/tracker/application';
|
||||
import { provideTrackerInfrastructure } from '@task-stream/web/tracker/infrastructure';
|
||||
import { appRoutes } from './app.routes';
|
||||
|
||||
/*
|
||||
* Composition root of the web client:
|
||||
* presenters (routes/pages) → application (NgRx signal stores, events) → domain ports ← infrastructure (GraphQL/HTTP)
|
||||
*/
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideBrowserGlobalErrorListeners(),
|
||||
provideRouter(
|
||||
appRoutes,
|
||||
// Route params / query params straight into component inputs (`key`, `issueKey`, `returnUrl`…).
|
||||
withComponentInputBinding(),
|
||||
withRouterConfig({ paramsInheritanceStrategy: 'always' }),
|
||||
),
|
||||
provideHttpClient(withFetch()),
|
||||
providePiUi(),
|
||||
|
||||
// API: same origin, proxied in development (proxy.conf.json) and by nginx in Docker.
|
||||
provideApiConfig(apiConfigFromLocation()),
|
||||
provideGraphql(),
|
||||
|
||||
// Ports → adapters
|
||||
provideIdentityInfrastructure(),
|
||||
provideTrackerInfrastructure(),
|
||||
{ provide: Notifications, useExisting: ToastService },
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user