Giter Club home page Giter Club logo

byob's Introduction

BYOB Build Status

Endpoints available:

GET all the states

/api/v1/states

Example response:

[
    {
        "id": 857,
        "state": "AL",
        "numberOfStations": 331,
        "created_at": "2018-05-16T21:05:58.865Z",
        "updated_at": "2018-05-16T21:05:58.865Z"
    }, ...
]

Query station search

/api/v1/states?numberOfStations=#

Example response:

[
    {
        "id": 857,
        "state": "AL",
        "numberOfStations": 331,
        "created_at": "2018-05-16T21:05:58.865Z",
        "updated_at": "2018-05-16T21:05:58.865Z"
    }
]

GET one state

/api/v1/states/:id

Example response:

[
    {
        "id": 857,
        "state": "AL",
        "numberOfStations": 331,
        "created_at": "2018-05-16T21:05:58.865Z",
        "updated_at": "2018-05-16T21:05:58.865Z"
    }
]

GET all the cities

/api/v1/cities

Example response:

[
    {
        "id": 404,
        "city": "New York City",
        "BD": 1,
        "CNG": 7,
        "E85": 0,
        "ELEC": 585,
        "HY": 0,
        "LNG": 0,
        "LPG": 1,
        "state_id": 888,
        "created_at": "2018-05-16T21:05:58.903Z",
        "updated_at": "2018-05-16T21:05:58.903Z"
    }, ...
 ]

GET one city

/api/v1/cities/:id

Example response:

[
    {
        "id": 404,
        "city": "New York City",
        "BD": 1,
        "CNG": 7,
        "E85": 0,
        "ELEC": 585,
        "HY": 0,
        "LNG": 0,
        "LPG": 1,
        "state_id": 888,
        "created_at": "2018-05-16T21:05:58.903Z",
        "updated_at": "2018-05-16T21:05:58.903Z"
    }
 ]

POST a new state

/api/v1/states

parameters (all required):

state: string,

numberOfStations: number

POST a new city

/api/v1/cities

parameters (all required):

city: string,

BD: number,

CNG: number,

E85: number,

ELEC: number,

HY: number,

LNG: number,

LPG: number,

PATCH a state

/api/v1/states/:id

parameters (at least one required):

state: 'WI'

AND/OR

numberOfStations: '29'    

PATCH a city

/api/v1/cities/:id

parameters (at least one required):

city: string

AND/OR

BD: number

AND/OR

CNG: number

AND/OR

E85: number

AND/OR

ELEC: number

AND/OR

HY: number

AND/OR

LNG: number

AND/OR

LPG: number

DELETE a state

/api/v1/states/:id

DELETE a city

/api/v1/cities/:id

byob's People

Contributors

charlesy712 avatar rvwatch avatar mmdberg avatar

Watchers

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