Bookx is a simple API built in GO and MongoDB.
To get a local copy up and running follow these simple steps.
- Go 1.10 and higher
- MongoDB Server 4.2.3
- MongoDriver
go get go.mongodb.org/mongo-driver/mongo
- gorilla/mux
go get -u github.com/gorilla/mux
- Cobra
go get -u github.com/spf13/cobra/cobra
- Clone the repo
git clone https://github.com/oasiscse/bookx.git
- Go to project directory and run -
go run main.go serve
Create Book [POST]: /api/books/create
Get all books [GET]: /api/books/info/all
Get All Books By Year [GET]: /api/books/info/all/{year}
Get by Book ID [GET]: /api/books/info/{bookid}
Delete single Book by ID [DELETE]: /api/books/remove/{bookid}
type Book struct {
ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
Title string `json:"title,omitempty" bson:"title,omitempty"`
Author string `json:"author,omitempty" bson:"author,omitempty"`
Publisher string `json:"psher,omitempty" bson:"psher,omitempty"`
Year string `json:"year,omitempty" bson:"year,omitempty"`
Category string `json:"cat,omitempty" bson:"cat,omitempty"`
BookID string `json:"bookid,omitempty" bson:"bookid,omitempty"`
}
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Open a Pull Request
Distributed under the MIT License.
Tweet me - @ihumaunkabir
Find me on ihumaun.com