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-server
ISC License
6 stars 0 forks source link
hafas linked-connections public-transport transit

hafas-linked-connections-server

Create a Linked Connections endpoint from a HAFAS client. Very hacky & slow.

npm version ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installation

npm install hafas-linked-connections-server

Usage

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