So, I have serverless project, i would like to run function as below
'use strict';
const report= require('./report');
module.exports.startAdMeta = (event, context) => {
report.init();
return "success";
}
I have problem with add "report" folder as module in handler.js. How to add module all file in lambda?
Response: { "errorMessage": "Cannot find module 'report'", "errorType": "Error", "stackTrace": [ "Function.Module._load (module.js:417:25)", "Module.require (module.js:497:17)", "require (internal/module.js:20:19)", "Object. (/var/task/handler.js:2:35)", "Module._compile (module.js:570:32)", "Object.Module._extensions..js (module.js:579:10)", "Module.load (module.js:487:32)", "tryModuleLoad (module.js:446:12)", "Function.Module._load (module.js:438:3)" ] }