Итак, у меня есть следующие функции на моем serverless.yml
functions:
getEstimate:
handler: handler.getEstimate
events:
- http:
path: /get-quotation
method: get
getQuotation:
handler: lalamove/index.getQuotation
events:
- http:
path: /lalamove-get-quote
method: get
, и у меня есть этот код в handler.js
, который вызывает функцию getQuotation () из lalamove / index.getQuotation.
'use strict';
var lalamove = require("./lalamove/index.js");
module.exports.getEstimate = (event, context, callback) => {
lalamove.getQuotation();
};
после развертывания без сервера, и я смотрю запустить конечную точку getEstimate, я получаю {"message": "Internal server error"}
, но если я пытаюсь запустить getQuotation, я получаю {"message":"hermbs"}
, который также должен быть напечатан при запуске getEstimate.
это мой index.js
'use strict';
module.exports.getQuotation = (data, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: "hermbs",
}),
};
callback(null, response);
};
я что-то здесь упускаю?