Reisekompis mellomlag skrevet i Node.js
This node.js-based application works as an abstraction layer between on-the-road mobile apps and Ruter's API.
This application is pretty easy to set up locally. You need node and npm installed, and that's about it!
If you don't have node and npm installed, you can check out these install scripts.
Once you've cloned the project, simply run npm install to fetch the dependencies.
To run, enter node app.js into your favorite terminal.
The application have the following JSON-producing endpoints available:
GET /search/:query
Searches Ruter's API for a stop. Returns a list of stops and the lines that stop there.
GET /poll/:stopId/:lineId
Polls a stop for a given line.
POST /poll
Polls a set of stops and lines for the next departures.
Parameter form:
[
{
id: 3010200, // Stop id
lines: [ 1, 2 ] // Array of line IDs
}, ...
]
Returns a list of line departures at the specified stop.