Example of crud api using go. It has the default methods: GET, POST, PUT and DELETE and use a Event model as example.
go run cmd/main.go
GET: "/api/events"
GET: "/api/events/{id}"
Need a body with the following structure
{
"name": "Big Event",
"description": "a very big event",
"address": "downtown square"
}
POST: "/api/events"
Need a body with the following structure (if some field is not present, it will be set to empty)
{
"name": "Big Event",
"description": "a very big event",
"address": "downtown square"
}
PUT: "/api/events/{id}"
DELETE: "/api/events/{id}"