Git Product home page Git Product logo

exceed-backend's Introduction

exceed--backend

route

/melody/create, method=POST

  • For create a melody by receive the json from the frontend in this for match
{
    "title": "baby shark",
    "note": ["A3", "A3",  "A3", "F3", "C4", "A3", "F3", "C4", "A3"]
}
  • If the melody title is the same as the melody title already in the database. The melody will not create and return {"result": "This title has been used"}
  • If the melody created. return {"result": "Create successfully"}
  • Note must be an array of string (40 string)

/melody/select?title=..., methods=PATCH

  • For selecting notes to play on the hardware
  • If the melody title is exist on database. Select that melody and return {"result" : "Select successfully"}. If not return {"result": "Cannot found the melody"}
  • For example, /melody/select?title=baby shark

/melody/select, methods=GET

  • For get the note that we selected on the frontend. The json will return in this format
{
    "result" : 
        [
            31, 33, 35, 37, 39, 
            41, 33, 35, 37, 39, 
            33, 35, 37, 39, 44,
            33, 35, 37, 39, 58
        ]
}
  • This route for hardware

/count , methods=GET

  • For get the total number of times the melody has been played
  • Return in this format
{
    "count": 1
}

/counter, methods=PATCH

  • For update the total number of times the melody has been played
  • This route for hardware
  • Use this route when the hardware is working

/melody/list, methods=GET

  • For get all the melody title and notes on the database
{
    "result" :
    [
        {
            "name": "baby shark",
            "notes": [740,659,0,494,554,587,554,554,587,554,440]
        },
        {
            "name": "did that",
            "notes": [31, 659, 659, 659, 31]
        }
    ]
}

/melody/delete?title=..., methods=DELETE

  • For delete the melody in the database
  • If this function is working correctly, return with this format
{
    "result": "1 documents deleted."
}

exceed-backend's People

Contributors

nuttapol-kor avatar bouncyyahomie 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.