Node.js wrapper for MBTA's RESTful API.
MBTA = require './src/mbta'
client = new MBTA("CURRENT_DEMO_KEY")
routePromise = client.findRoutes("Ferry")
routePromise.then(
(response) ->
console.log JSON.stringify response, false, 4
,
(err) ->
console.log err
).done()
var MBTA = require('./index');
var client = new MBTA("CURRENT_DEMO_KEY");
var routePromise = client.findRoutes("Ferry");
routePromise.then(
function(response) {
console.log(JSON.stringify(response, false, 4));
},
function(err){
console.log(err);
}
).done();
both output:
[
{
"route_id": "Boat-F4",
"route_name": "Charlestown Ferry",
"route_type": "4",
"mode_name": "Boat"
},
{
"route_id": "Boat-F1",
"route_name": "Hingham Ferry",
"route_type": "4",
"mode_name": "Boat"
},
{
"route_id": "Boat-F2",
"route_name": "Quincy Ferry",
"route_type": "4",
"mode_name": "Boat"
},
{
"route_id": "Boat-F2(H)",
"route_name": "Quincy/Hull Ferry",
"route_type": "4",
"mode_name": "Boat"
}
]