我创建了一个使用knex的api,创建了一个excel文件并将其上传到s3并返回一个url,这在无服务器脱机状态下工作正常,但在lambda上则无法使用。
exports.handler = (event, context, callback) => {
knex.select(
'Id',
'Name'
).from(AREA)
.then(async function (rows) {
url = await exportExcel(rows); // this returns a URL which should be returned back
res = {
statusCode: 200,
body: url
};
console.log(res); // this prints correct url in res
callback(null, res); // callback is called with res which contains url in body
})
};
我得到的错误
{
"message": "Internal server error"
}