Giter Club home page Giter Club logo

serverless-go-dynamodb-lambda-microservice's Introduction

Serverless REST Product Microservice in Go and Lambda

REST Product microservice application written in Go using DynamoDB and Amazon Lambda.

Prerequisites

Quick Start

  1. Clone the repo
git clone [email protected]:miamiruby/serverless-go-dynamodb-lambda-microservice.git
cd serverless-go-dynamodb-lambda-microservice
  1. Install Go dependencies
dep ensure
  1. Compile functions as individual binaries for deployment package:
./scripts/build.sh

You need to perform this compilation step before deploying.

  1. Deploy!
serverless deploy

You can perform steps 2 and 3 simultaneously by running ./scripts/deploy.sh.

  1. To Create a Record:

Use curl to create product:

> curl -X POST -H "Content-Type:application/json" https://<hash>.execute-api.<region>.amazonaws.com/dev/products --data '{
            "title": "The Hitchhikers Guide to the Galaxy",
            "description": "42",
            "done": false,
            "price": 10.00,
            "created_at": "2018-01-23 08:48:21.211887436 +0000 UTC m=+0.045616262"
 }'

  1. List All Records:

Use curl to list products:

> curl https://<hash>.execute-api.<region>.amazonaws.com/dev/products
{
    "products": [
        {
            "id": "d2e38e20-2e73-1e24-9390-1747cf5d19b5i",
            "title": "The Hitchhikers Guide to the Galaxy",
            "description": "42",
            "done": false,
            "price": 1.00,
            "created_at": "2018-01-23 08:48:21.211887436 +0000 UTC m=+0.045616262"
        }
    ]
}
  1. Delete Record:

Use curl to delete a product:

> curl -X DELETE https://<hash>.execute-api.<region>.amazonaws.com/dev/products/d2e38e20-2e73-1e24-9390-1747cf5d19b5i

serverless-go-dynamodb-lambda-microservice's People

Contributors

miamiruby avatar

Stargazers

Oliver Parkinson avatar Enguerrand Allamel avatar  avatar  avatar Reo YAMADA avatar Tyler Hildebrandt avatar Quico Moya avatar Kenny Day avatar Dante Haskell Elrik avatar

Watchers

 avatar James Cloos avatar Matthew T. Stewart avatar  avatar

Forkers

arouam

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.