node package manager

hafas-rest-api

hafas-rest-api

Expose a HAFAS client via an HTTP REST API.

npm version build status ISC-licensed chat on gitter

Installing

npm install hafas-rest-api

Usage

const hafas = require('hafas-client')
const dbProfile = require('hafas-client/p/db')
 
const createApi = require('.')
 
const config = {
    hostname: 'example.org',
    port: 3000,
    name: 'my-hafas-rest-api',
    homepage: 'https://github.com/someone/my-hafas-rest-api'
}
 
const client = hafas(dbProfile)
const api = createApi(client, config)
 
api.listen(config.port, (err) => {
    if (err) console.error(err)
})

Contributing

If you have a question or have difficulties using hafas-rest-api, 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.