Plugin for "Conan: The Deployer" enabling the Api Gateway service from the AWS provider. Normally, you will use this along with the conan-aws-lambda plugin, so you can point your resources to a lambda function. Check out the example:
import conan from "conan";
import ConanAwsApiGatewayPlugin from "conan-aws-api-gateway";
conan = new Conan();
conan.use(ConanAwsApiGatewayPlugin);
conan
.api("myApi")
.stage("staging")
.get("/myResources/{id}") //define your entire resource path with path parameters mapped automatically
.headers("Content-Type", "Custom-Header") //define your headers easily
.lambda("myLambda", "staging") //this is when you want to point the resource to an existing lambda, with alias support!
.statusCodes({
"200": "",
"500": "Internal*" //this is the selection pattern to exeute on the error message to throw a 500 http status code
})
.responseHeaders({
"Allow-Control-Allow-Origin": "*" //this will enable cors on that resource
});
Every build and release is automatically tested on the following platforms:
If your platform is not listed above, you can test your local environment for compatibility by copying and pasting the following commands into your terminal:
npm install conan-aws-api-gateway
cd node_modules/conan-aws-api-gateway
gulp test
Copy and paste the following command into your terminal to install conan-aws-api-gateway:
npm install conan-aws-api-gateway --save-dev
See something that could use improvement? Have a great feature idea? We listen!
You can submit your ideas through our issues system, or make the modifications yourself and submit them to us in the form of a GitHub pull request.
We always aim to be friendly and helpful.
It's easy to run the test suite locally, and highly recommended if you're using Conan-aws-api-gateway.js on a platform we aren't automatically testing for.
npm test