回答

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

+0

这与'Gateway Response'没有方法响应有关,所以此答案不起作用 – JagsSparrow

相关问题