Skip to content

Latest commit

 

History

History
82 lines (58 loc) · 1.52 KB

README.md

File metadata and controls

82 lines (58 loc) · 1.52 KB

Backend

Circle CI Go Report

REST API for table reservation

Created to avoid issue with CORS, which appears with axios in VueJS Apps.

Development

Compile source code

$> go build -o main cmd/server/main.go

Run server

$> ./main

Swagger

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

Usage

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"
  }
]

License

Project released under the terms of the MIT license.