GithubHelp home page GithubHelp logo

challenge-api's Introduction

Challenge API

This REST API is a mock to run challenges at events. Basically participants can submit an answer to a challenge, and an algorithm will pick a winnder.

The data are mocked in this example.

Here is a postman collection and HTML documentation of the REST API.

Quick start

git clone
cd 
npm install
DEBUG=api* node server.js

Resources

If runnning locally, replace $server with http://localhost:8080 if running the heroku live demo, replace with https://pixelscamp-challenge.herokuapp.com

List challenges

GET {{server}}/api/challenges
[
    {
        "id": "pixelscamp2017-day1",
        "event_id": "pixelscamp2017",
        "begin": "2017-09-28T10:00:00.000Z",
        "end": "2017-09-28T18:00:00.000Z",
        "status": "not started"
    }
]

Submit answer

POST {{server}}/api/challenges/pixelscamp2017-day1/answers
{
	"weight" : 12345
}
{
    "createdAt": "2017-09-20T16:34:24.204Z",
    "data": {
        "weight": 12345
    },
    "submitter": {
        "email": "[email protected]",
        "devnetId": "123456789",
        "firstName": "Stève",
        "lastName": "Sfartz"
    }
}

List answers

GET {{server}}/api/challenges/pixelscamp2017-day1/answers
[
    {
        "createdAt": "2017-09-20T16:34:24.204Z",
        "data": {
            "weight": 12345
        },
        "submitter": {
            "email": "[email protected]",
            "devnetId": "123456789",
            "firstName": "Stève",
            "lastName": "Sfartz"
        }
    }
]

Compute winners

GET {{server}}/api/challenges/pixelscamp2017-day1/winners?weight=12345
[
    {
        "createdAt": "2017-09-20T16:34:24.204Z",
        "data": {
            "weight": 12345
        },
        "submitter": {
            "email": "[email protected]",
            "devnetId": "123456789",
            "firstName": "Stève",
            "lastName": "Sfartz"
        },
        "score": 1.4224165
    }
]

challenge-api's People

Contributors

objectisadvantag avatar

Stargazers

 avatar

Watchers

 avatar  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.