Skip to content

Commit 4a26744

Browse files
griest024gracetxgao
authored andcommitted
feat(driver): add in-memory config (graycoreio#3175)
1 parent 84dd8c3 commit 4a26744

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

Diff for: libs/driver/in-memory/src/config/default.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { DaffInMemoryDriverConfig } from './type';
2+
3+
export const DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT: DaffInMemoryDriverConfig = {
4+
apiBase: 'api',
5+
};

Diff for: libs/driver/in-memory/src/config/public_api.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './default';
2+
export * from './token';
3+
export * from './type';

Diff for: libs/driver/in-memory/src/config/token.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { createConfigInjectionToken } from '@daffodil/core';
2+
3+
import { DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT } from './default';
4+
import { DaffInMemoryDriverConfig } from './type';
5+
6+
export const {
7+
token: DAFF_IN_MEMORY_DRIVER_CONFIG,
8+
provider: provideDaffInMemoryDriverConfig,
9+
} = createConfigInjectionToken<DaffInMemoryDriverConfig>(DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, 'DAFF_IN_MEMORY_DRIVER_CONFIG');

Diff for: libs/driver/in-memory/src/config/type.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export interface DaffInMemoryDriverConfig {
2+
/**
3+
* The base path segment of the API route.
4+
*/
5+
apiBase: string;
6+
}

Diff for: libs/driver/in-memory/src/public_api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './backend/public_api';
22
export * from './driver/public_api';
3+
export * from './config/public_api';

0 commit comments

Comments
 (0)