constructor()

in cdk/lib/construct/handler.ts [17:39]


    constructor(scope: Construct, id: string, props: HandlerProps) {
        super(scope, id);

        const authHandler = new lambdanode.NodejsFunction(this, "AuthHandler", {
            entry: "../backend/authorizer/index.ts",
            environment: {
                USER_POOL_ID: props.userPool.userPoolId,
                APP_CLIENT_ID: props.userPoolClient.userPoolClientId,
            },
        });

        const websocketHandler = new lambdanode.NodejsFunction(this, "WebSocketHandler", {
            entry: "../backend/websocket/index.ts",
            environment: {
                CONNECTION_TABLE_NAME: props.connectionIdTable.tableName,
            },
        });

        props.connectionIdTable.grantReadWriteData(websocketHandler);

        this.authHandler = authHandler;
        this.websocketHandler = websocketHandler;
    }