/books

Primary LanguageGoApache License 2.0Apache-2.0

Go API Server for books

A sample API that uses a Books store as an example

Overview

This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. By using the OpenAPI-Spec from a remote server, you can easily generate a server stub.

Running the server

To run the server, follow these simple steps:

go run main.go

To run the server in a docker container

docker build --network=host -t books .

Once image is built use

docker run --rm -it books 

To get list of books you need to execute:

curl -X GET http://localhost:8080/v1/api/books

To search with a specific criteria you can run the above command as example

curl -X POST --header "Content-Type: application/json" \
    -d '{"Author": "Ralph Ellison"}' \
        http://localhost:8080/v1/api/books/search