Slide 77
Slide 77 text
@slobodan_
const {
httpResponse,
parseApiEvent,
SnsRepository
} = require('../common')
const main = require('./main')
async function handler(event) {
const { body, headers } = parseApiEvent(event)
// Create instance of SNS notification repository
const notification = new SnsRepository(
process.env.topic
)
// Invoke main function with all dependencies
await main(body, headers, notification)
return httpResponse()
}