Code Monkey home page Code Monkey logo

gimmy's Introduction

gimmy

About

Gimmy is simple API to manage creating classes and bookings for a fictional gym written in Golang

Installation instructions

You should have at least Go 1.13 installed since this project uses Go modules

git clone [email protected]:zuzuleinen/gimmy.git
go run main.go

Notes

The server runs on port :8282. You can change the port inside main.go

API

POST /classes - creates a new class

Sample request:

{
  "name": "Karate",
  "capacity": 26,
  "start_date": "2021-04-30",
  "end_date": "2021-05-01"
}

Sample response:

Returns the ID of the created class object

{
  "id": "458c0903-c394-4a63-8289-57cc5bf59305"
}

GET /classes

Sample response:

{
  "classes": [
    {
      "id": "458c0903-c394-4a63-8289-57cc5bf59305",
      "name": "Karate",
      "start_date": "2021-04-30",
      "end_date": "2021-05-01",
      "capacity": 26
    },
    {
      "id": "53ee2b12-2fab-4f32-86f7-183821096da5",
      "name": "Salsa",
      "start_date": "2021-03-21",
      "end_date": "2021-05-01",
      "capacity": 30
    }
  ]
}

POST /bookings - creates a new booking

Sample request:

{
  "name": "Andrei",
  "date": "2021-05-01",
  "class_id": "458c0903-c394-4a63-8289-57cc5bf59305"
}

Sample response:

Returns the ID of the created booking object.

{
  "id": "b719bda8-86d1-4929-81c7-cd82369e037d"
}

Error response

Usually error responses return an 4XX code with following format:

{"message":"`end_date` is required"}

gimmy's People

Contributors

zuzuleinen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.