add travellers age parameter

Co-Authored-By: Jannis R <mail@jannisr.de>
This commit is contained in:
jannes.t13@gmail.com 2023-03-23 19:44:02 +01:00 committed by Jannis R
parent 779e67886b
commit 448294ba5c

8
api.js
View file

@ -12,7 +12,7 @@ import Redis from 'ioredis'
import {createCachedHafasClient} from 'cached-hafas-client'
import {createRedisStore} from 'cached-hafas-client/stores/redis.js'
import serveStatic from 'serve-static'
import {parseBoolean} from 'hafas-rest-api/lib/parse.js'
import {parseBoolean, parseInteger} from 'hafas-rest-api/lib/parse.js'
import {loyaltyCardParser} from './lib/loyalty-cards.js'
import {route as stations} from './routes/stations.js'
import {route as station} from './routes/station.js'
@ -60,6 +60,12 @@ const mapRouteParsers = (route, parsers) => {
default: 'false',
parse: parseBoolean,
},
age: {
description: 'Age of traveller',
type: 'integer',
defaultStr: '*adult*',
parse: parseInteger
},
}
}