1.0.0 • Published 6 years ago
hafas-monitor-trips-server v1.0.0
hafas-monitor-trips-server
A server that manages HAFAS monitors.
Installation
npm install hafas-monitor-trips-serverUsage
const createServer = require('hafas-monitor-trips-server')
const server = createServer(hafas)
const subA = server.subscribe({
north: 52.51, south: 52.4, west: 13.35, east: 13.38
})
const subB = server.subscribe({
north: 52.505, south: 52.45, west: 13.355, east: 13.375
})
subA.on('stopover', stopover => console.log('A', stopover))
subB.on('stopover', stopover => console.log('B', stopover))subAandsubBhave overlapping bounding boxes, so they will share one monitor.hafasis ahafas-client/*-hafasinstance.subscribe(bbox)returns anEventEmitter, emitting the same events as ahafas-monitor-tripsinstance.
See example.js for a full example.
Contributing
If you have a question or need support using hafas-monitor-trips-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.
1.0.0
6 years ago