REST API for table reservation
Created to avoid issue with CORS, which appears with axios in VueJS Apps.
Compile source code
$> go build -o main cmd/server/main.go
Run server
$> ./main
Install latest version of go-swagger
go get -u github.com/go-swagger/go-swagger/cmd/swagger
Generate swagger documentation
swagger generate spec -o docs/api.json --scan-models
Generate markdown documentation
swagger-markdown -i docs/api.json -o docs/api.md
Build and deploy using docker.
See API documentation for more information.
Example with httppie.
$> http GET http://localhost:8080/reservations
[
{
"duration": 120,
"email": "[email protected]",
"full_name": "John Doe",
"guests": 5,
"id": 1,
"phone": "+380123456789",
"state": "created",
"table_id": 1,
"time": "2019-11-25T23:50:00Z"
}
]
Project released under the terms of the MIT license.