diff --git a/libs/driver/in-memory/src/driver/base.class.ts b/libs/driver/in-memory/src/driver/base.class.ts new file mode 100644 index 0000000000..c246b06838 --- /dev/null +++ b/libs/driver/in-memory/src/driver/base.class.ts @@ -0,0 +1,16 @@ +import { InMemoryBackendConfigArgs } from 'angular-in-memory-web-api'; + +/** + * The base class for in-memory drivers. + */ +export abstract class DaffInMemoryDriverBase { + /** + * The URL of the corresponding backend. + */ + protected readonly url = `/${this.config.apiBase}/${this.collectionName}`; + + constructor( + private config: InMemoryBackendConfigArgs, + private collectionName: string, + ) {} +} diff --git a/libs/driver/in-memory/src/driver/public_api.ts b/libs/driver/in-memory/src/driver/public_api.ts new file mode 100644 index 0000000000..06c440cd46 --- /dev/null +++ b/libs/driver/in-memory/src/driver/public_api.ts @@ -0,0 +1 @@ +export * from './base.class'; diff --git a/libs/driver/in-memory/src/public_api.ts b/libs/driver/in-memory/src/public_api.ts index 9717fb0f44..531afc737b 100644 --- a/libs/driver/in-memory/src/public_api.ts +++ b/libs/driver/in-memory/src/public_api.ts @@ -1 +1,2 @@ export * from './backend/public_api'; +export * from './driver/public_api';