This is simple example restful api server
$ go get github.com/iamgafurov/go-rest-api-example
$ cd $GOPATH/src/github.com/iamgafurov/go-rest-api-example
$ go build
$ ./go-rest-api-example
-
http://localhost:2222/api/v1/foods/{category}
GET
: get list of foods by categoryPOST
: create food
-
http://localhost:2222/api/v1/foods/food/{id}
GET
: get food by idPUT
: update foodDELETE
: remove food
http://localhost:2222/api/v1/foods/foodinfo/
DELETE
: remove foodinfo
{
"FoodInfoID" : int,
"OrgFoodID" : int,
"Size" : FoodSize,
"CookTime" : string,
"PackingTime" : string,
"Price" : float32
}
FoodSize{
FoodSizeID int,
Name string
}