Skip to content

Commit 48ab415

Browse files
authored
Merge pull request #4339 from hove-io/gormun_v2
Use Gormun v2 for journeys and route_schedules APIs
2 parents ae36953 + e525aed commit 48ab415

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

docker/apache/jormungandr.default.conf

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
RewriteRule ^/(.*route_schedules.*) %{ENV:GORMUNGANDR_URL}/$1 [P]
2424
ProxyPassReverse / %{ENV:GORMUNGANDR_URL}/
2525

26+
RewriteCond %{ENV:GORMUNGANDR_VERSION} 2
27+
RewriteCond %{REQUEST_URI} ".*journeys.*"
28+
RewriteCond %{QUERY_STRING} "from="
29+
RewriteCond %{QUERY_STRING} "to="
30+
RewriteRule ^/(.*) %{ENV:GORMUNGANDR_URL}/$1 [P]
31+
ProxyPassReverse / %{ENV:GORMUNGANDR_URL}/
32+
2633
AddOutputFilterByType DEFLATE application/json
2734

2835
CustomLog /var/log/apache2/access.log vhost_combined_timetaken

docker/run_jormungandr.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ Usage: ${0##*/} -m monitor-process -r max-requests
1010
-m [0|1] activate monitor-process
1111
-r max-requests before reload for jormungandr worker
1212
-g Optional: gormungandr url for route_schedules API (Example: http://gormungandr)
13+
-v Optional: gormungandr version API : route_schedules(1), route_schedules and journeys(2)
1314
EOF
1415
}
1516

16-
while getopts "m:r:c:g:h" opt; do
17+
while getopts "m:r:c:g:v:h" opt; do
1718
case $opt in
1819
m) monitor_processes=$OPTARG
1920
;;
@@ -23,6 +24,8 @@ while getopts "m:r:c:g:h" opt; do
2324
;;
2425
g) gormungandr_url=$OPTARG
2526
;;
27+
v) gormungandr_version=$OPTARG
28+
;;
2629
h|\?)
2730
show_help
2831
exit 1
@@ -50,9 +53,10 @@ fi
5053

5154
jormungandr_cache2="name=jormungandr,items=${jormun_cache_items}"
5255

53-
if [[ ! -z $gormungandr_url ]]
56+
if [[ ! -z $gormungandr_url ]] && [[ ! -z $gormungandr_version ]];
5457
then
5558
echo "export GORMUNGANDR_URL=$gormungandr_url" >> /etc/apache2/envvars
59+
echo "export GORMUNGANDR_VERSION=$gormungandr_version" >> /etc/apache2/envvars
5660
fi
5761
# run apache2
5862
service apache2 start

0 commit comments

Comments
 (0)