答案 0 :(得分:0)
好问题。我相信你可以在s-function.json
文件中这样做:
"endpoints": [
{
"path": "/test",
"method": "GET",
"authorizationType": "none",
"apiKeyRequired": false,
"requestParameters": {},
"requestTemplates": {},
"responses": {
"400": {
"statusCode": "400"
},
"default": {
"statusCode": "200",
"responseParameters": {},
"responseModels": {"text/html": "Empty"},
"responseTemplates": {"text/html": "$input.json('$')"},
"text/html": ""
}
}
}
]
来源:
https://github.com/serverless/serverless/issues/587 https://github.com/serverless/serverless/issues/463
答案 1 :(得分:0)
在docker ps --filter "label=project=user-app"
的资源部分添加,如下所示
serverless.yml