Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-http-api-gateway

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-http-api-gateway

A Framework to handle AWS HTTP APIs with AWS Lambda

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

AWS HTTP API Gateway Framework

npm version Build Status Coverage Status

AWS API Gateway - HTTP API Framework -- Also called API Gateway v2.

A framework to easily implement HTTP APIs in AWS API Gateway. Implement CRUD operations in less than 100 lines of code!

Test a working demo for your own with this repo.

Docs

The framework complete docs can be found here.

Quick start

  1. Install via npm
npm i aws-http-api-gateway
  1. Setup your serverless function
# serverless.yml
service:
  name: PetStore
provider:
  name: aws
  runtime: nodejs12.x
functions:
  PetsGetManyApi:
    handler: src/apis/pets/get-many.handler
    events:
      - httpApi: 'GET /pets'
  1. Code your handler
// src/apis/pets/get-many.js
'use strict';

const { GetManyApi, ApiHandler } = require('aws-http-api-gateway');

const PetConnector = require('../../connectors/pets');

const petConnector = new PetConnector();

class PetGetManyApi extends GetManyApi {

	get dataConnector() {
		return petConnector;
	}

};

module.exports.handler = ApiHandler(PetGetManyApi);

  1. Code your data connector (implement with your favorite database)
'use strict';

const dbHandler = require('some-db-handler');

module.exports = class PetsConnector {

	get(getParams) {
		return dbHandler.get(getParams);
	}

};
  1. You're ready to go. Just deploy your service!
serverless deploy

Keywords

FAQs

Package last updated on 06 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc