Giter VIP home page Giter VIP logo

logactaesque-dice-resolver's Introduction

Logactaesque Dice Resolver

This service resolves which dice are to be employed when playing a Logactaesque match fixture. The dice it returns are aligned with dice rolled as part of the the Logactaesque Dice Service

The application is a Sinatra-based ruby application. To run locally, clone the repository, navigate into the directory and then:

# installs gems...
bundle install

# run the application on port 9292
bundle exec unicorn -p 9292 -c ./config/unicorn.rb

The service presently holds a single endpoint called resolve, hence:

localhost:9292/resolve?homeTeam=Wolves&awayTeam=WBA

will return:

{"homeDice":"blue","awayDice":"red"}

Hence for a given match, the blue dice will be used to determine home goals, and red for away. If a home team and away team name are supplied, it will (for the moment) always return the above JSON with a response code of 200, however in the near future the resolver will have additional logic to allow dice to be selected based upon:

  • Competition
  • Recent form
  • Number of points between teams (for league matches)

If either team is missing in the request, then the response code is 400 and you will see something akin to the following error message:

{"error":"Missing away team"}

Available tests can be run via rspec:

rspec --format=documentation

logactaesque-dice-resolver's People

Contributors

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