Git Product home page Git Product logo

aws-serverless-api's Introduction

aws-serverless-api

AWS Serverless RESTful API

About

Serverless RESTful API created using Serverless with Feathers.

Stack Used:

  • Serverless (AWS Lambda) - Creating & Deploying serverless app
  • FeathersJS (with Express) - Creating REST Api
  • MongoDB - Database management

Getting Started

This project created in purpose to learn & experience creating a serverless service using AWS Lambda.

Below are API services created & available publicly to test. You may also find the API list via api.http file.

Get contact list

To see more detail on querying, go to feathers querying.

baseUrl : https://wtgqgtivzc.execute-api.ap-southeast-1.amazonaws.com/dev

GET {{baseUrl}}/contact
Parameter Type Description
$sort object Optional. To sort return data based on specified field parameter. Acceptable value: (-1=descending) or (1=acending)
$limit number Optional. To limit maximum number of record to return.
fieldName string Optional. To filter record based on specified field parameters.

Example request

GET {{baseUrl}}/contact?[$sort][firstName]=-1

CURL

curl -H "Content-type: application/json" 'https://wtgqgtivzc.execute-api.ap-southeast-1.amazonaws.com/dev/contact?[$sort][firstName]=1'

Get specific contact information

GET {{baseUrl}}/contact/{{_id}}
Parameter Type Description
_id string Required. Records ID to get

Example request

GET {{baseUrl}}/contact/61223baa61a88f9a00407358

CURL

curl -H "Content-type: application/json" 'https://wtgqgtivzc.execute-api.ap-southeast-1.amazonaws.com/dev/contact/61223baa61a88f9a00407358'

Create new contact

POST {{baseUrl}}/contact
Parameter Type Description
firstName string Required.
lastName string Required.
phoneNumber string Required.
email string Required.
address string Required.
birthDate string Required. Date format in DD-MM-YYYY

Example request

POST {{baseUrl}}/contact

Data

Acceptable request data:

{
"firstName" : string,
"lastName" : string,
"phoneNumber" : string, 
"email" : string,
"address" : string,
"birthDate" : string //with format (DD-MM-YYYY)
}

CURL

curl -X POST -H "Content-type: application/json" -d '{
  "firstName": "Test",
  "lastName": "User",
  "phoneNumber": "60123456610",
  "email": "[email protected]",
  "address": "Selangor",
  "birthDate": "19-06-1991"
}' 'https://wtgqgtivzc.execute-api.ap-southeast-1.amazonaws.com/dev/contact'

Update specific contact information

PATCH {{baseUrl}}/contact?_id={{_id}}
Parameter Type Description
_id string Required. Records ID to update
firstName string Optional.
lastName string Optional.
phoneNumber string Optional.
email string Optional.
address string Optional.
birthDate string Optional. Date format in DD-MM-YYYY

Example request

PATCH {{baseUrl}}/contact?_id=61223baa61a88f9a00407358

CURL

curl -X PATCH -H "Content-type: application/json" -d '{
  "address": "Cheras, Kuala Lumpur, Malaysia"
}' 'https://wtgqgtivzc.execute-api.ap-southeast-1.amazonaws.com/dev/contact?_id=61223baa61a88f9a00407351'

Data

Acceptable request data:

{
"firstName" : string,
"lastName" : string,
"phoneNumber" : string, 
"email" : string,
"address" : string,
"birthDate" : string //with format (DD-MM-YYYY)
}

Remove specific contact information

DELETE {{baseUrl}}/contact?_id={{_id}}
Parameter Type Description
_id string Required. Records ID to delete

Example request

DELETE {{baseUrl}}/contact?_id=61223baa61a88f9a00407358

CURL

curl -X DELETE -H "Content-type: application/json" 'https://wtgqgtivzc.execute-api.ap-southeast-1.amazonaws.com/dev/contact?_id=6122fcda384444000828894e'

Responses

Successful request returns a JSON response in the following format:

{
"message" : string,
"status" : number,
"data" : object
}

Help

For more information visit

feathers

docs.feathersjs.com

serverless

serverless docs

aws-serverless-api's People

Contributors

nizamsaidin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.