【发布时间】:2017-11-03 22:04:24
【问题描述】:
我正在尝试使用通过 webpack 生成的处理程序部署 aws lambda 函数。这是最终的 webpack 文件。为了便于理解,我删除了大部分标准 webpack 代码。
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ }
/************************************************************************/
/******/ ({
/***/ "./storesHandler.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports.get = function (event, context, callback) {
var response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event
})
};
callback(null, response);
// Use this code if you don't use the http event with the LAMBDA-PROXY integration
// callback(null, { message: 'Go Serverless v1.0! Your function executed successfully!', event });
};
/***/ }),
/***/ 0:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("./storesHandler.js");
/***/ })
/******/ });
但是,当我尝试执行部署在 AWS 上的函数时,出现以下错误。文件名是storesHandler.js
{
"errorMessage": "Handler 'get' missing on module 'storesHandler'"
}
【问题讨论】:
标签: amazon-web-services webpack aws-lambda