Find matches from CommuterConnections.org
Base URL for requests from Commuter Connections
Make a SOAP request to Commuter Connections to get the number of carpools available for a given starting, ending location, and search radius.
parameter | type | description |
---|---|---|
opts |
Object | Options object |
import {findMatches} from 'commuter-connections'
findMatches({
startLat: 39.0436,
startLng: -77.4875,
endLat: 38.9047,
endLng: -77.0164,
startRadius: 2,
endRadius: 2
}).then((matches) => {
console.log(matches) // # of matches found
}, handleError)
Returns Promise
, promise
Verify find the options required for findMatches
parameter | type | description |
---|---|---|
opts |
Object | Options object |
import {verifyFindMatchesOptions} from 'commuter-connections'
const errors = verifyFindMatchesOptions(opts)
if (errors.length > 0) handleErrors(errors)
Returns Array
, errors Errors found in the options
Create a SOAP client to use with commuter connections.
import {createSoapClient} from 'commuter-connections'
createSoapClient().then((client) => {
// use the client
})
Returns Promise
, promise
Requires nodejs.
$ npm install commuter-connections
$ npm test