Skip to content

Commit

Permalink
feat(driver): add in-memory config (#3175)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 authored Oct 9, 2024
1 parent e520410 commit b3a5a1a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/driver/in-memory/src/config/default.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { DaffInMemoryDriverConfig } from './type';

export const DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT: DaffInMemoryDriverConfig = {
apiBase: 'api',
};
3 changes: 3 additions & 0 deletions libs/driver/in-memory/src/config/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './default';
export * from './token';
export * from './type';
9 changes: 9 additions & 0 deletions libs/driver/in-memory/src/config/token.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createConfigInjectionToken } from '@daffodil/core';

import { DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT } from './default';
import { DaffInMemoryDriverConfig } from './type';

export const {
token: DAFF_IN_MEMORY_DRIVER_CONFIG,
provider: provideDaffInMemoryDriverConfig,
} = createConfigInjectionToken<DaffInMemoryDriverConfig>(DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, 'DAFF_IN_MEMORY_DRIVER_CONFIG');
6 changes: 6 additions & 0 deletions libs/driver/in-memory/src/config/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface DaffInMemoryDriverConfig {
/**
* The base path segment of the API route.
*/
apiBase: string;
}
1 change: 1 addition & 0 deletions libs/driver/in-memory/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './backend/public_api';
export * from './driver/public_api';
export * from './config/public_api';

0 comments on commit b3a5a1a

Please sign in to comment.