ranitdey / serverless-api-lambda

Serverless api built using Serverless framework and Lambda functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lambda-serverless

CI Status

Serverless api built using Serverless framework , Lambda functions , AWS API Gateway Proxy and NodeJS .This API uses MongoDB as a database for all CRUD operations.This application is ready to be deployed in AWS Lambda and with Serverless framework its just a command away. Only we need to configure the AWS account settings in the Serverless.YML .

Running project

TODO:
1.Authentication

Run server locally with serverless framework

# This will emulate the actual AWS Lambda environment so that we could run and test it in local
sls offline start --port 4500 --skipCacheInvalidation

Endpoints

{get} http://localhost:4500/api/ : This will fetch all the products from MongoDB with a rate limiter.

{post} http://localhost:4500/api/ : This endpoint will allow user to add products. Request should be made with respect to proper Json contract.

# contract example
{
  "name": "iphone",
  "description": "Apple iphone",
  "price": 70000,
  "ispublished": true
}

{put} http://localhost:4500/api/{id} : This endpoint will allow user to update products. Request should be made with respect to proper Json contract.
{delete} http://localhost:4500/api/courses/ : This will allow user to delete products from MongoDB

Modules used

Some of non-standard modules used:

About

Serverless api built using Serverless framework and Lambda functions


Languages

Language:JavaScript 100.0%