Open nocontent06 opened 2 months ago
Hey,
you're welcome to host an instance! I can then direct oebb.transport.rest
to you.
I'd love to do so. But I didn't manage to authorise at the OEBB's mgate.exe... do you know how to do that?
[…] I didn't manage to authorise at the OEBB's mgate.exe... do you know how to do that?
hafas-client
's ÖBB profile shows how to do it.
It will be the most straightforward for you to pass it into hafas-rest-api@5
, this is how v6.bvg.transport.rest
(a.k.a. bvg-rest@6
), v6.db.transport.rest
(a.k.a. db-rest@6
) & v6.vbb.transport.rest
(a.k.a. vbb-rest@6
) do it too.
Ah i see what you mean...
I created a repo running on oebb.transport.rest
I recommend you to use hafas-rest-api@5
to build the API, both to save time and to get an API that behaves like v6.{bvg,db,vbb}.transport.rest
.
Okay sure...
The API is running on https://oebb.macistry.com temporarily if you wanna try it out.
e.g. https://oebb.macistry.com/journeys?from=8100085&to=8100147
The API is running on https://oebb.macistry.com temporarily if you wanna try it out.
Do you want me to configure a subdomain v6.oebb.transport.rest
?
Oh that'd be perfect!
I'll update the code that it uses hafas-rest-api soon
Please adapt this so something meaningful! From the hafas-client
readme:
Because the operators of the HAFAS endpoint should be able to contact you about excessive traffic, please pass a link to your project/program (or an email address) into
createClient()
:
v6.oebb.transport.rest
is now a CNAME
for oebb.macistry.com
.
Perfect!
I've updated my repo so far, that everything is ready for transition.
I just have to write a documentation.
The index page is currently oebb.macistry.com and the API chills on oebb.macistry.com/api
So basically... what do we need more?
Test: https://oebb.macistry.com/api/journeys?from=8100085&to=8100147
It's running :)
I just have to write a documentation.
I highly recommend using hafas-rest-api@5
. You will get a generated API documentation as well as an OpenAPI spec out-of-the-box. Both of them are generated from the parameters metadata in each route (e.g. here for /stops/:id/departures
).
You will also get built-in:
Accept-Encoding
) supportLink
headers that tell clients how to fetch earlier/later resultsThe index page is currently oebb.macistry.com and the API chills on oebb.macistry.com/api
I recommend you to prefix/namespace your entire API with the version, e.g. $version.oebb.transport.rest
or oebb.transport.rest/$version
. Another option is using content negotiation for that, but it's easier to mess up.
Over time, I've had to make breaking changes with my *.transport.rest
APIs several times. (You will have to make such breaking changes too, given that you use hafas-client
, which will eventually change its response format.)
Having the v6
prefix with my *.transport.rest
APIs really helps with deprecating the old one and deploying the new one next to it.
So basically... what do we need more?
You should configure your server to serve requests under v6.oebb.transport.rest
.
How about implementing the OEBB to transport.rest?