Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.keys(exports).forEach(key => {
module.exports[key] = middy(exports[key])
.use(
loggerMiddleware({
logger: log
})
)
.use(httpEventNormalizer())
.use(jsonBodyParser())
.use(validator({ inputSchema: exports[key].schema }))
.use(cors())
.use(autoProxyResponse())
.use(httpErrorHandler())
})
}
Object.keys(exports).forEach(key => {
const handler = middy(exports[key])
.use(
loggerMiddleware({
logger: log
})
)
.use(httpEventNormalizer())
.use(jsonBodyParser())
.use(cors())
.use(autoProxyResponse())
.use(httpErrorHandler())
if (options.ssmParameters && process.env.SLIC_STAGE !== 'test') {
handler.use(
ssm({
cache: true,
names: options.ssmParameters,
awsSdkOptions: {
endpoint: process.env.SSM_ENDPOINT_URL
}
})
)
}