Code Monkey home page Code Monkey logo

byob-baseball's Introduction

Build Your Own Backend - MLB Baseball edition

Build Your Own Backed (BYOB) is a solo project at the Turing School of Software and Design. As Front-End Developers this project is designed to give us experience building databases using Express, Knex, and PostgreSQL, and building a RESTful API. More information about original assignment can be found here

This app is deployed to Heroku: https://byob-baseball.herokuapp.com/

API Documentation:

Welcome to the BYOB MLB Baseball edition API! This documentation should familiarize you with the resources available and how to consume them with HTTP requests.

Root URL

The Root URL for BYOB Baseball is localhost:3000 The documentation below requires prepending the Root URL to the endpoints in order to fulfill the requests.

GET localhost:3000

This endpoint provides all information on all available endpoints within the BYOB Baseball API.

Example Request:

localhost:3000

Example Response:
   HTTP/1.0 200 OK
   Content-Type: application/json
   {
      "divisions": "localhost:3000/api/v1/divisions"
      "teams": "localhost:3000/api/v1/teams"
   } 
Attributes:
  • divisions string -- The URL root for the Divisions endpoint
  • teams string -- The URL root for the Teams endpoint

Divisions Endpoints

The Divisions endpoints provide information about all the Divisions in Major League Baseball or a specific division. You can also create a new Division or edit an existing a Division.

Endpoints:

  • /api/v1/divisions -- GET data for all Divisions
  • /api/v1/divisions/:id -- GET data for a specific Division
  • /api/v1/divisions -- POST add a new Division

GET /api/v1/divisions

This endpoint returns all Divisions data.

Example Request:
Example Response:
Attributes:

GET /api/v1/divisions/:id

This endpoint returns all data for a specific Division. Required parameters: division id.

Example Request:

localhost:3000/api/v1/divisions/1

Example Response:
[
    {
        "id": 1,
        "name": "AL East",
        "league": "American League",
        "created_at": "2019-05-01T17:34:24.348Z",
        "updated_at": "2019-05-01T17:34:24.348Z"
    }
]
Attributes:

POST /api/v1/divisions

This endpoint allows you to create a new Division.

Example Request:

Example Response:

Installation:

These instructions will get a copy of the project up and running on your local machine for usage and testing purposes.

Backend

clone down the repo: $ git clone https://github.com/jessicalyn/BYOB-baseball

cd into directory and run npm install: $ npm install

launch in your browser: $ npm start

Future Development and Extensions Notes:

Technologies Used

BYOB - MLB Baseball Edition was built using:

  • Express
  • Knex
  • PostgreSQL

Credits

Credit for this project goes to:

byob-baseball's People

Contributors

jessicalyn avatar

Watchers

James Cloos 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.