mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 14:49:36 +02:00
update readme
This commit is contained in:
parent
d992961421
commit
8026689ee8
2 changed files with 12 additions and 2 deletions
2
api.js
2
api.js
|
@ -46,7 +46,7 @@ const config = {
|
|||
|
||||
|
||||
const start = async () => {
|
||||
const vendo = createClient(dbProfile, 'my-hafas-rest-api', config);
|
||||
const vendo = createClient(dbProfile, process.env.USER_AGENT || process.env.HOSTNAME || 'link-to-your-project-or-email', config);
|
||||
const api = await createApi(vendo, config);
|
||||
|
||||
api.listen(config.port, (err) => {
|
||||
|
|
12
readme.md
12
readme.md
|
@ -48,7 +48,17 @@ Strictly speaking, permission is necessary to use this library with the DB APIs.
|
|||
|
||||
## Usage
|
||||
|
||||
See an example in [api.js](api.js). It shows how you can use `db-vendo-client` together with `hafas-rest-api` in order to run a [FPTF](https://github.com/public-transport/friendly-public-transport-format) API server. The [Dockerfile](Dockerfile) serves this API.
|
||||
Use it as a dependency, e.g. just replacing [hafas-client](https://github.com/public-transport/hafas-client/):
|
||||
|
||||
```
|
||||
npm i db-vendo-client
|
||||
```
|
||||
|
||||
See an example in [api.js](api.js). It shows how you can use `db-vendo-client` together with `hafas-rest-api` in order to run a [FPTF](https://github.com/public-transport/friendly-public-transport-format) API server. The [Dockerfile](Dockerfile) serves this API:
|
||||
|
||||
```
|
||||
docker run -e USER_AGENT=my-awesome-program -p 3000:3000 ghcr.io/public-transport/db-vendo-client
|
||||
```
|
||||
|
||||
There are [community-maintained TypeScript typings available as `@types/hafas-client`](https://www.npmjs.com/package/@types/hafas-client).
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue