回答

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

相關問題