-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhandlerHttp.ts
More file actions
13 lines (11 loc) · 822 Bytes
/
handlerHttp.ts
File metadata and controls
13 lines (11 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
import { CloseAccount, closeAccount } from "./app/domain/closeAccount";
import { apiGatewayAdapter } from "./app/instrastructure/driving/apiGatewayAdapter";
import { StubAmazingEnergyClient } from "./app/instrastructure/driven/accountManager/StubAmazingEnergyClient";
import { StubInstrumentation } from "./app/instrastructure/driven/instrumentation/StubInstrumentation";
// Instantiate core functionality with its dependencies
const accountCloser: CloseAccount = closeAccount({
instrumentation: new StubInstrumentation(), // Implements Instrumentation interface (port)
accountManager: new StubAmazingEnergyClient(), // Implements AccountManager interface (port)
});
// Initialise the handler with the apiGatewayAdaptor which depends on the CloseAccount port
export const handler = apiGatewayAdapter(accountCloser);