Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
withCors(async (event, dependencies) => {
try {
const id = req(event).params.id;
const output = await app(id, dependencies);
return res(output);
} catch (err) {
return res(err.message, 500);
}
});
convert(event) {
const apiGatewayEvent = req(event);
return {
payload: Object.assign(
{ body: apiGatewayEvent.body },
apiGatewayEvent.params
),
headers: apiGatewayEvent.headers
};
}
};
convert(event) {
const apiGatewayEvent = req(event);
return {
payload: apiGatewayEvent.body,
headers: Object.assign(
{},
apiGatewayEvent.headers,
apiGatewayEvent.params
)
};
}
};