Skip to content

Commit

Permalink
feat(Examples): Add example for testing tripsForLocation endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedhossamdev committed Jul 3, 2024
1 parent b3bd85d commit 8328365
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/trip-for-locations.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import onebusaway from '../dist/index.mjs';

const oba = new onebusaway({
apiKey: 'TEST',
});

// This is initial example for testing the response of the tripsForLocation endpoint
async function main() {
const response = await oba.tripsForLocation.retrieve({
lat: 47.653,
lon: -122.307,
latSpan: 0.008,
lonSpan: 0.008,
});
console.log(response.data.list[0].serviceDate);
}

main();

0 comments on commit 8328365

Please sign in to comment.