Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function invokeFunction(root, path) {
process.chdir(root);
const { handler } = require('hops-lambda/lambda');
return handler({ requestContext: { path }, path }, {}).then(response => {
if (response.isBase64Encoded) {
response.body = Buffer.from(response.body, 'base64').toString('utf-8');
}
return response;
});
}