add travellers age parameter
Co-Authored-By: Jannis R <mail@jannisr.de>
This commit is contained in:
parent
779e67886b
commit
448294ba5c
1 changed files with 7 additions and 1 deletions
8
api.js
8
api.js
|
@ -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
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue