Giter Site home page Giter Site logo

book-store-spanner-db's Introduction

book-store

How to Test

  • Run pgAdapter
  • Add the following envs
    export dbHost="localhost" # host of pgAdapter
    export dbPort="5433" # port on which pgAdapter is running
    export dbName="psql-interface" # spanner db name
    export dbUser=""
    export dbPassword=""
  • Run the application, which we can test the DML queries.

Routes

@route   GET /version
@desc    App version

@route   GET /healthcheck
@desc    Healthcheck API

@route   GET /books
@desc    Get all books
@resp
[
    {
        "id": "52302b94-5241-4cac-ad1a-6d42c73a93ee",
        "name": "The Heart Is a Lonely Hunter",
        "author": "Carson McCullers"
    },
    {
        "id": "01136e18-a56e-420a-8e2c-db3319745255",
        "name": "The Lord of the Rings",
        "author": "J. R. R. Tolkien"
    }
]

@route   GET /books/:id
@desc    Get a book by id
@resp
{
    "id": "01136e18-a56e-420a-8e2c-db3319745255",
    "name": "The Lord of the Rings",
    "author": "J. R. R. Tolkien"
}

@route   POST /books
@desc    Create a new book
@req
{
    "name": "Heart Is a Lonely Hunter",
    "author": "Carson McCullers"
}
@resp
{
    "id": "52302b94-5241-4cac-ad1a-6d42c73a93ee",
    "name": "Heart Is a Lonely Hunter",
    "author": "Carson McCullers"
}

@route   POST /books
@desc    Update a book by id
@req
{
    "id": "52302b94-5241-4cac-ad1a-6d42c73a93ee",
    "name": "The Heart Is a Lonely Hunter",
    "author": "Carson McCullers"
}
@resp
{
    "id": "52302b94-5241-4cac-ad1a-6d42c73a93ee",
    "name": "The Heart Is a Lonely Hunter",
    "author": "Carson McCullers"
}

@route   DELETE /books/:id
@desc    Delete a book by id
@resp    NoContent

Docker Image

nix build .#dockerImage

book-store-spanner-db's People

Contributors

conscious-puppet avatar

Watchers

 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.