this api does a simple CRUD operations on a single table mysql Database .
this is build on top off gin framwork and GORM library
the api use different HTTP methods ( GET, POST, PUT, and DELETE )
to make this work correctly you need to :
- you need to clone gin and gorm
- you need to have mysql installed in your machine ( install xampp if you don't have )
- create a new empty database and call it 'api-go'
to add the gin framwork (copy and past this into ur terminal)
go get "https://github.com/gin-gonic/gin"
to add the GORM library (copy and past this into ur terminal)
go get "https://github.com/go-gorm/gorm"
Listening and serving HTTP on :8888
GET /v1/api/book/:id
--> get single bookGET /v1/api/books
--> get all booksPOST /v1api/book
--> create new bookPUT /v1api/book/:id
--> update bookDELETE /v1api/book/:id
--> delete book
Thank you..~