How to use Digitransit UI for OTP with API key?
Hi folks, Thank you very much for creating and maintaining this repository. Please accept my appreciation!
I am new to the Digitransit UI. I would like to use it as UI for the following OpenTripPlaner API.
The following curl instruction is an example on how to use this API. You can see that an API key is required to use this API.
curl -X GET 'http://gtfsr.vbn.de/api/routers/connect/plan?arriveBy=false&date=05-25-2021&fromPlace=53.08287,8.81334&toPlace=53.05270,8.78617&time=13:00:00&mode=WALK,TRANSIT&maxWalkDistance=300' -H 'Authorization: insert API key' -H 'Host: gtfsr.vbn.de'
Considering the API key, would you say I am still able to interact with this UI? If yes, I appreciate any advice how to achieve it. Cheers!
I think you can use https://github.com/relay-tools/react-relay-network-modern with urlMiddleware and batchMiddleware, or with authMiddleware. That library is already in use but we don't currently use for this purpose. I think additionally you need to add the headers to setUpAvailableTickets method in server/server.js.