summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-04-24 18:18:27 +0200
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-04-24 18:18:27 +0200
commita85266ef8432271d988f00e83da9f5ed350f7097 (patch)
tree25d3353eab0bb129d6801c21a385a13ab8a1f640 /lib/DBInfoscreen.pm
parent2d66be08e488198f69497fed3299280d43c89b29 (diff)
Support JSON output for /z/:train/*station
Closes #13
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r--lib/DBInfoscreen.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm
index dc3b403..49e7402 100644
--- a/lib/DBInfoscreen.pm
+++ b/lib/DBInfoscreen.pm
@@ -279,8 +279,9 @@ sub startup {
$r->get('/_ajax_mapinfo/:tripid/:lineno')->to('map#ajax_route');
$r->get('/map/:tripid/:lineno')->to('map#route');
- $r->get( '/z/:train/*station' => 'train_at_station' )
- ->to('stationboard#station_train_details');
+ $r->get( '/z/:train/*station' => [ format => [ 'html', 'json' ] ] )
+ ->to( 'stationboard#station_train_details', format => undef )
+ ->name('train_at_station');
$r->get( '/z/:train' => [ format => [ 'html', 'json' ] ] )
->to( 'stationboard#train_details', format => undef )->name('train');