Function_Name:
handler: function path
events:
- http:
path: path/{id}
method: get
我想添加apikey所需的功能,我该怎么做?我不想手工从法律。谢谢!
无服务器框架可以选择在serverless.yml
的provider
部分下添加apiKeys
。参考下面的示例代码。
service: demo-api-key
provider:
name: aws
runtime: nodejs12.x
apiKeys:
- "demo-apikey"
functions:
hello:
handler: handler.hello
events:
- http:
path: hello
method: get
message:
handler: private.message
events:
- http:
path: message
method: get
private: true
或者以其他方式签出此插件。