Skip to content

Commit b3a5a1a

Browse files
authored
feat(driver): add in-memory config (#3175)
1 parent e520410 commit b3a5a1a

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed
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+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './default';
2+
export * from './token';
3+
export * from './type';
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');
+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+
}
+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)