16 lines
664 B
JavaScript
16 lines
664 B
JavaScript
import express from 'express';
|
|
import { createClient } from 'hafas-client';
|
|
import { profile as dbProfile } from 'hafas-client/p/db/index.js';
|
|
const app = express();
|
|
const port = 3000;
|
|
// Adapt this to your project! createClient() won't work with this string.
|
|
const userAgent = 'sperwing@sperwing.de';
|
|
// create a client with the Deutsche Bahn profile
|
|
const client = createClient(dbProfile, userAgent);
|
|
app.get('/', (req, res) => {
|
|
client.journeys('8011167', '8000261', { results: 1 }).then(result => res.send(result));
|
|
});
|
|
app.listen(port, () => {
|
|
return console.log(`Express is listening at http://localhost:${port}`);
|
|
});
|
|
//# sourceMappingURL=app.js.map
|