joshvince / commuter

The Node.js version of a web service that provides additional data about the London Underground
0 stars 0 forks source link

Tube status #1

Closed joshvince closed 7 years ago

joshvince commented 7 years ago

This creates a whole bunch of functionality and scaffolding:

And, in terms of getting actual Tube Statuses:

The scoreArray is currently returned to the client. In the next round, the app will call the TFL api and update the internal DB at regular intervals (every 5 mins). Then, when the client calls the /lines/northern endpoint, the client will receive a "Score", which will be some jiggery pokery maths to do with whether there has been any delays on the line in the last hour (12 entries in the array, remember).

joshvince commented 7 years ago

OK, this is updated:

Every 5 minutes, this app calls the TFL API and requests the status of the northern line.

When the client hits the /lines/northern endpoint, the app returns a "score", which is calculated with some simple maths that treats delays/closure responses from TFL as high/bad and good service responses from TFL as low/good. The score can be considered a rough guide as to how the line has performed in the last hour.

This is ready for the front end work to begin now. I'll do that in another branch.