函数时出现问题"/>
使用无服务器框架部署NodeJS函数时出现问题
我有一个具有此体系结构的应用程序:
-Function1
.index.js
-Function2
.index.py
.requirements.txt
-Function3
.index.py
.requirements.txt
-Function4
.index.py
.requirements.txt
-node_modules
.serverless.yml
.package.json
我的问题是,当我调用无服务器部署时,我最终在NodeJS函数(Function1)中遇到了整个应用程序
仅使用NodeJS函数会发生此问题,Python函数仅具有与每个函数相关的代码。
注意 :我的serverless.yml中有这个:
package:
individually: true
plugins:
- serverless-python-requirements
- serverless-iam-roles-per-function
- serverless-pseudo-parameters
- serverless-plugin-include-dependencies
谢谢你的帮助。
回答如下:我正在使用/ typescript / es7来实现无服务器功能,请在serverless.yml中尝试以下操作:
plugins:
- ...
- ...
provider:
name: aws
runtime: **nodejs8.10**
stage: ...
profile: ...
region: ...
functions:
[function name]:
handler: function1/index.js
events:
- http:
method: get
...
更多推荐
使用无服务器框架部署NodeJS函数时出现问题
发布评论