Code Monkey home page Code Monkey logo

rustball's Introduction

rustball

Simple webapp to demo the MongoDB Rust driver (https://github.com/mongodbinc-interns/mongo-rust-driver-prototype).

Setup

  1. Start mongod

  2. Run mongoimport -d mlb -c players --file mlb_players.json in the repo root to import the data

  3. Run cargo build to compile the app

  4. Run cargo run to start the server

Usage

  1. Load the page localhost:3000/league (or any of the other defined pages) in your browser and start using the app!

REST API

  • /averages/high
    • Type: GET
    • Response: list of top 20 hitters by average
  • /averages/low
    • Type: GET
    • Response: list of bottom 20 hitters by average
  • /batters
    • Type: GET
    • Response: list of teams with left-handed and right-handed batters grouped
  • /league
    • Type: GET
    • Response: list of all teams
  • /player/:id
    • Type: GET
    • Response: single document with the player's info and tags
  • /player/:id/add_tag
    • Type: POST
    • JSON data: "tag" => tag to add to player
    • Response: object specifying success or error
  • /tags/:tag
    • Type: Get
    • Response: list of players who have the given tag
  • /team/:team
    • Type: GET
    • Response: list of players on the team
    • Examples
      • /team/BOS
      • /team/PHI
      • /team/KC
  • /team/:team/name
    • Type: GET
    • Response: Full name of the team

rustball's People

Contributors

saghm avatar

Stargazers

Shaun Savage avatar Rocco avatar

Watchers

James Cloos avatar  avatar  avatar

rustball's Issues

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.