Skip to content

palestine-nights/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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": "johndoe@example.com",
    "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.