Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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).