AWS API Gateway开发者门户提供了自定义模板的功能,通过将模板上传到AWS S3桶并在API Gateway中进行配置,可以自定义门户的外观和感觉。
以下是使用自定义模板渲染开发者门户的基本步骤:
以下是一个使用AWS CLI上传模板文件并配置API Gateway开发者门户的示例命令:
aws s3 cp index.html s3://my-bucket/my-folder/
aws apigateway update-rest-api --rest-api-id --patch-operations \
'[{
"op" : "replace",
"path" : "/developerPortalConfiguration/developerPortalType",
"value" : "AWS"
},
{
"op" : "replace",
"path" : "/developerPortalConfiguration/developerPortalName",
"value" : ""
},
{
"op" : "replace",
"path" : "/developerPortalConfiguration/themeSettings/layout/theme",
"value" : "CUSTOM"
},
{
"op" : "add",
"path" : "/developerPortalConfiguration/themeSettings/layout/customLayout",
"value" : "//index.html