Skip to content

riffaud/flights-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flights API build status

Node.js API that accepts JSON posted to /flights , filters that data, and returns a few fields for each flight. It is publicaly accessible at https://my-flight-api-project.herokuapp.com/flights. Any push to master will trigger a travis CI test build, and deploy to that domain.

Prerequisites

The package depends on Node.js.

Installation

To install, run in a terminal:

npm install

And then to start the API:

npm start

You can now send POST requests to the only available endpoint http://localhost:8080/flights. The body should have the following format:

{
  "flights": [
    {
      "flightNumber": "801",
      "arrival": {
        "onblocks": {
          "time": "2017-06-21T01:00:00Z",
          "type": "scheduled"
        },
        "airport": "PER",
        "scheduled": "2017-06-21T01:00:00Z"
      },
      "departure": {
        "offblocks": {
          "time": "2017-06-20T21:00:00Z",
          "type": "scheduled"
        },
        "airport": "DRW",
        "scheduled": "2017-06-20T21:00:00Z"
      },
      "originDateLocal": "2017-06-21",
      "lastChanged": "2017-06-20T06:20:57Z",
      "flightSlug": "QF801",
      "originDate": "2017-06-20",
      "airline": "QF"
    }
  ]
}

Running the tests

This software depends on Mocha and Chai for running tests.

npm test

Built with

About

Parsing/filtering flight data API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published