This project is a rust lambda for requesting the next two departures times for a single station in the PTV network. Currently only the Mernda train line is supported.
Example:
$ curl "localhost:3000/departures?station_name=clifton_hill"
{
"toCityDepartures": [{ "minutes": 9 }, { "minutes": 27 }],
"fromCityDepartures": [{ "minutes": 26 }, { "minutes": 56 }]
}
To run and test locally, make sure you have installed:
cp ./env.json.example ./env.json
Update the values in env.json
with the values provided by PTV.
Once you have your environment setup, you can run the application locally with:
make build
make invoke
If you want to run a local server you can via:
make build
make start_api
curl "localhost:3000/departures?station_name=clifton_hill"