README
apex-apigateway
Deploy your Apex project on AWS API Gateway using Swagger configuration
Installation
npm install -g apex-apigateway
Usage
Usage: /usr/local/bin/apex-apigateway <command> [options]
Commands:
create <name> [description] Create a new RestAPI on AWS API Gateway
deploy Update RestAPI with the new Swagger definitions
list List RestAPI
Options:
--help Show help [boolean]
create
/usr/local/bin/apex-apigateway create <name> [description]
Options:
--help Show help [boolean]
--clone, -c The ID of the RestAPI that you want to clone from. [string]
--force, -f Force creating RestAPI.
Overriding existing configuration. [boolean]
deploy
/usr/local/bin/apex-apigateway deploy
Options:
--help Show help [boolean]
--stage, -s API-Gateway Stage Name [string] [default: "development"]
--alias, -a Lambda Alisa Name [string]
--stdout, -o Output Swagger [boolean]
configuration
project.json
{
"x-api-gateway": {
"rest-api-id": "9siwjdu882",
"swagger-func-template": {
"consumes": ["application/json"],
"produces": ["application/json"],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
},
"headers": {
"Access-Control-Allow-Headers": {
"type": "string"
},
"Access-Control-Allow-Methods": {
"type": "string"
},
"Access-Control-Allow-Origin": {
"type": "string"
}
}
},
"400": {
"description": "400 response"
}
},
"x-amazon-apigateway-binary-media-types": ["application/json"],
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200",
"responseParameters": {
"method.response.header.Access-Control-Allow-Origin": "'*'"
}
},
"(.*)(Error|Exception|errorMessage)(.*)": {
"statusCode": "400"
}
},
"requestTemplates": {
"application/json": "{\n \"method\": \"$context.httpMethod\",\n \"body\" : $input.json('