- RESTFul API
- Full-featured: GET List of Cake, GET Detail of Cake, ADD New Cake, Update Cake (PATCH), and DELETE Cake
- Include Unit Test
- Easy For modify
- Applied request validation
GO "Programing Language"
MySQL "Database"
Docker "Container"
$ git clone https://github.com/rikiafifuddin/cakestoreGO.git
open MySQL and create Database
- Open MySQL Workbench
- Menu "Sever"-> "Data Import"
- Import from Self-contained file
- select
cakestore_cake.sql
provided - chose default target schema
- start import
- run SQL script provide
database.sql
- open your directory
$ cd .\api\
$ go run main.go
- use API path on documentation or use Postman Collection provided
PrivyID.postman_collection.json
(import to your postman app)
- make sure you have docker instaled on your device
- open terminal
$ docker build -t [container name] .
example$ docker build -t privyid .
- wait until docker finish building container
- run docker
$ docker run -p 8080:8080 -t [container name]
example$ docker run -p 8080:8080 -t privyid
- use API path on documentation or use Postman Collection provided
PrivyID.postman_collection.json
(import to your postman app)
router.HandleFunc("/cakes", service.ListOfCake).Methods("GET")
router.HandleFunc("/cakes/{id}", service.DetailOfCake).Methods("GET")
router.HandleFunc("/cakes", service.AddNewCake).Methods("POST")
router.HandleFunc("/cakes/{id}", service.UpdateCake).Methods("PATCH")
router.HandleFunc("/cakes/{id}", service.DeleteCake).Methods("DELETE")
{
"title" : "Maple",
"description" : "Cake From heaven",
"rating" : 7,
"Image" : "https://img.taste.com.au/ynYrqkOs/w720-h480-cfill-q80/taste/2016/11/sunny-lemon-cheesecake-102220-1.jpeg"
}
all variable must be fill except "rating"
{
"description" : "Cake From heaven",
"rating" : 7,
}
Edit/patch whatever you want to edit, one or more variable at the same time
IF YOU HAVE QUESTION YOU CAN CONTACT ME ON EMAIL: [email protected]
"Technical Test LINK" GO Backend Engineer