Function: SetCurrentAdapterMiddleware()
Function: SetCurrentAdapterMiddleware()
function SetCurrentAdapterMiddleware(context, next): Promise<IBlueprint>;
Middleware to set the current adapter configuration in the blueprint.
This middleware checks if there is only one adapter in the list, if yes return it, otherwise it looks for the preferred adapter, followed by the adapter with the matching alias, and finally the default adapter. The selected adapter is then set in the blueprint.
Parameters
context
BlueprintContext
<IBlueprint
, ClassType
>
The configuration context containing the modules and blueprint.
next
NextPipe
<BlueprintContext
<IBlueprint
, ClassType
>, IBlueprint
>
The next function in the pipeline to continue processing.
Returns
Promise
<IBlueprint
>
The updated blueprint or a promise resolving to the updated blueprint.
Example
await SetCurrentAdapterMiddleware({ modules, blueprint }, next);