UNPKG

serverless-spy

Version:

CDK-based library for writing elegant integration tests on AWS serverless architecture and an additional web console to monitor events in real time.

29 lines (27 loc) 680 B
const require_common_SpyEventSender = require('../common/SpyEventSender.js'); //#region functions/sendMessage.ts const handler = async (event) => { const spyEventSender = new require_common_SpyEventSender.SpyEventSender({ scope: process.env["SSPY_ROOT_STACK"], iotEndpoint: process.env["SSPY_IOT_ENDPOINT"] }); try { await spyEventSender.connect(); await spyEventSender.publishSpyEvent(event); } catch (e) { console.error(e); return { statusCode: 500, body: e?.stack }; } finally { await spyEventSender.close(); } return { statusCode: 200, body: "Data sent." }; }; //#endregion exports.handler = handler; //# sourceMappingURL=sendMessage.js.map