Giter Site home page Giter Site logo

boldly-go-rest's Introduction

Boldly Go REST

Simple RESTful service to demonstrate the ease of setting a HTTP service using Go.

Data Storage

This service uses DynamoDB to persist data. Check out the docs for more information.

AWS Access

To access your AWS DynamoDB tables, you will need an AWS account with an IAM user that has access to Read, Write DynamoDB tables. Once the IAM user is created, get the access key and secret and store them in environment variables:

  • AWS_ACCESS_KEY_ID: The IAM user access key
  • AWS_SECRET_KEY: The IAM user secret

Dependency Management

This service uses go dep for the dependency management tool. After pulling the code down, run dep ensure; this will install necessary dependencies to the project and get it ready for running.

Endpoints

  • Ping: Health Check for the service.
    • endpoint: GET /api/v1/ping
    • CURL Example
      curl -XGET http://localhost:5002/api/v1/ping
    • Example Response:
      {
          "version": "0.0.1",
          "health": "HEALTHY",
          "msg": "Looking good, beautiful"
      }
  • Get Bank: Get a User Bank Record
    • endpoint: GET /api/v1/user/{owningUserId}/bank/{bankId}; where
      • {owningUserId} is the id of the user that the bank belongs to &
      • {bankId} is the unique id of the bank.
    • CURL example
      curl -XGET http://localhost:5002/api/v1/user/[email protected]/bank/01e173f4-02a2-4310-a7cc-e2b919f13aac
    • Example Response:
      {
          "owningUserId": "[email protected]",
          "bankId": "01e173f4-02a2-4310-a7cc-e2b919f13aac",
          "bankName": "US Bank",
          "accountNumber": "2112"
      }
  • Save Bank: Save a new User Bank record
    • endpoint: POST /api/v1/bank
    • Example Request Body
      {
      	"owningUserId": "[email protected]",
      	"bankName": "BANK NAME",
      	"accountNumber": "1234"
      }
    • CURL example
      curl -X POST -H "Content-Type: application/json" \
      -d '{"owningUserId": "4b7b2def-e76e-48bf-993b-8ec2b193b855", "bankName": "BANK NAME", "accountNumber": "1234"}' \
      http://localhost:5002/api/v1/bank
    • Example Response
      {
        "owningUserId": "[email protected]",
        "bankId": "b920cfc7-c455-4ac6-b856-f9d3a416d9d1",
        "bankName": "BANK NAME",
        "accountNumber": "1234"
      }

boldly-go-rest's People

Watchers

James Cloos avatar Chris Whited 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.