Я создал API на AWS API Gateway. Я использовал это для прокси в stati c приложении, например под названием sample-app, которое я развернул для netlify.
Конфигурация openapi для него прилагается ниже.
Мои вопросы:
- Почему это не работает?
- Как мне заставить API Gateway просто добавить /?
- Или, есть ли лучшие альтернативы?
openapi: "3.0.1"
info:
title: "sample-api"
version: "2020-04-29T23:24:23Z"
servers:
- url: "https://sample.com"
paths:
/apps/sample-app/{proxy+}:
x-amazon-apigateway-any-method:
parameters:
- name: "proxy"
in: "path"
required: true
schema:
type: "string"
x-amazon-apigateway-integration:
uri: "https://sample-app.netlify.app/{proxy}"
responses:
default:
statusCode: "200"
requestParameters:
integration.request.path.proxy: "method.request.path.proxy"
passthroughBehavior: "when_no_match"
httpMethod: "ANY"
cacheNamespace: "2ns27y"
cacheKeyParameters:
- "method.request.path.proxy"
type: "http_proxy"
/apps/sample-app:
x-amazon-apigateway-any-method:
responses:
"200":
description: "200 response"
content:
application/json:
schema:
$ref: "#/components/schemas/Empty"
x-amazon-apigateway-integration:
uri: "https://sample-app.netlify.app/"
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_match"
httpMethod: "ANY"
type: "http_proxy"