Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derhuerst/hafas-linked-connections-server
[work in progress] – Create a Linked Connections endpoint from a HAFAS client.
https://github.com/derhuerst/hafas-linked-connections-server
hafas linked-connections public-transport transit
Last synced: 2 days ago
JSON representation
[work in progress] – Create a Linked Connections endpoint from a HAFAS client.
- Host: GitHub
- URL: https://github.com/derhuerst/hafas-linked-connections-server
- Owner: derhuerst
- License: isc
- Created: 2019-10-06T20:13:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-20T22:53:09.000Z (over 2 years ago)
- Last Synced: 2024-12-25T00:30:12.437Z (16 days ago)
- Topics: hafas, linked-connections, public-transport, transit
- Language: JavaScript
- Homepage: https://github.com/derhuerst/hafas-linked-connections-server#hafas-linked-connections-server
- Size: 43.9 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# hafas-linked-connections-server
**Create a [Linked Connections](https://linkedconnections.org) endpoint from a [HAFAS client](https://github.com/public-transport/hafas-client).** Very hacky & slow.
[![npm version](https://img.shields.io/npm/v/hafas-linked-connections-server.svg)](https://www.npmjs.com/package/hafas-linked-connections-server)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/hafas-linked-connections-server.svg)
[![support me via GitHub Sponsors](https://img.shields.io/badge/support%20me-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)
[![chat with me on Twitter](https://img.shields.io/badge/chat%20with%20me-on%20Twitter-1da1f2.svg)](https://twitter.com/derhuerst)## Installation
```shell
npm install hafas-linked-connections-server
```## Usage
```js
'use strict'const createHafasClient = require('hafas-client')
const vbbProfile = require('hafas-client/p/vbb')
const createServer = require('hafas-linked-connections-server.')const hafasClient = createHafasClient(vbbProfile, 'my awesome program')
const baseUrl = 'https://my-linked-connections-endpoint/'
const bbox = { // Berlin
north: 52.53,
west: 13.355,
south: 52.5,
east: 13.43
}const server = createServer(baseUrl, hafasClient, bbox)
server.listen(3000)
```*Note:* Because linked open data tools tend to re-fetch resources often, I strongly recommend to use `hafas-linked-connections-server` with [`cached-hafas-client`](https://github.com/public-transport/cached-hafas-client). [`example.js`](example.js) shows how to do it.
## Contributing
If you have a question or need support using `hafas-linked-connections-server`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/hafas-linked-connections-server/issues).