Kelch
Kelch enables you to build REST API incredibly easily using JavaScript and AWS Serverless Application Model. Kelch deploys your REST API codes written by JavaScript to AWS Lambda and deploys and configs AWS API Gateway.
You can use Kelch and deploy your REST API code to your AWS account by following steps.
How to use
Install Kelch:
$ npm install -g kelch
Make directory for codes:
$ mkdir kelch-sample && cd kelch-sample
Generate a sample code and config file:
$ kelch init
$ lskelch-config.json sample.js
Create REST APIs (sample.js):
// You can define functions corresponding to each HTTP method { // By returning value as it is, Kelch will return Http status code 200 and body containing returned value return 'Hello Kelch !!';} { // You can get body, query string values, path parameters etc. from req passed by Kelch var body = reqbody;} { // You can set HTTP status code you want to return return statusCode: 204 ;} // You don't need to prepare all HTTP method functions// function del(req) {// }
Deploy created Rest APIs:
$ kelch deploy ... REST APIs URL:https://[api-gateway-no].execute-api.[aws-region].amazonaws.com/api/sample
AWS Lambda functions and AWS API Gateway will be deployed to your AWS account. API endpoint is defined according to file name (ex: deployed sample.js can be accessed via https://[endpoint]/api/sample)
Command Help
Usage: kelch COMMAND [ARGS]... Options: --version --help Commands: init --stack-name --s3-bucket create-resource --name create-config --stack-name --s3-bucket deploy --stack-name --s3-bucket delete --stack-name