mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
37 lines
776 B
Markdown
37 lines
776 B
Markdown
# `serverInfo([opt])`
|
|
|
|
**Fetches meta information from the HAFAS endpoint.**
|
|
|
|
With `opt`, you can override the default options, which look like this:
|
|
|
|
```js
|
|
{
|
|
versionInfo: true, // query HAFAS versions?
|
|
language: 'en', // depends on the profile
|
|
}
|
|
```
|
|
|
|
## Example
|
|
|
|
As an example, we're going to use the [SVV profile](../p/svv):
|
|
|
|
```js
|
|
import {createClient} from 'hafas-client'
|
|
import {svvProfile} from 'hafas-client/p/svv.js'
|
|
|
|
const client = createClient(svvProfile, 'my-awesome-program')
|
|
|
|
await client.serverInfo()
|
|
```
|
|
|
|
```js
|
|
{
|
|
// version of the HAFAS Connection Interface (HCI), the API that hafas-client uses
|
|
hciVersion: '1.23',
|
|
|
|
timetableStart: '20200517',
|
|
timetableEnd: '20201212',
|
|
serverTime: '2020-07-19T21:32:12+02:00',
|
|
realtimeDataUpdatedAt: 1595187102,
|
|
}
|
|
```
|