-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
696 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
packages/middleware/__tests__/integration/bootstrap/api/success/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/middleware/__tests__/integration/bootstrap/serverWithInitFn.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { apiClientFactory } from "../../../src/apiClientFactory"; | ||
import * as api from "./api"; | ||
import { AlokaiContainer, getLogger } from "../../../src"; | ||
|
||
const init = (settings: any, alokai: AlokaiContainer) => { | ||
const logger = getLogger(alokai); | ||
logger.info("Init fn!"); | ||
return { | ||
config: settings, | ||
client: null, | ||
}; | ||
}; | ||
|
||
const onCreate = async ( | ||
config: Record<string, unknown> = {}, | ||
alokai: AlokaiContainer | ||
) => { | ||
const logger = getLogger(alokai); | ||
logger.info("oncreate"); | ||
|
||
return { | ||
config, | ||
client: null, | ||
}; | ||
}; | ||
|
||
const { createApiClient } = apiClientFactory({ | ||
onCreate, | ||
api, | ||
}); | ||
|
||
export { createApiClient, init }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.