Basic Architecture of Sport Web
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { HttpClient, type HttpClientOptions } from './http-client';
|
||||
import { createHealthResource, type HealthResource } from './resources/health';
|
||||
|
||||
/**
|
||||
* Resource modules are added here as the backend grows — one file per bounded
|
||||
* context under `src/resources/`, mirroring the NestJS module names exactly.
|
||||
* Keep them thin: URL + types, no business logic and no caching policy (that is
|
||||
* the calling app's decision).
|
||||
*/
|
||||
export interface ApiClient {
|
||||
readonly http: HttpClient;
|
||||
readonly health: HealthResource;
|
||||
}
|
||||
|
||||
export function createApiClient(options: HttpClientOptions): ApiClient {
|
||||
const http = new HttpClient(options);
|
||||
|
||||
return {
|
||||
http,
|
||||
health: createHealthResource(http),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user