Skip to content

Commit

Permalink
Add new kela routing and map endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
optionsome committed Nov 14, 2023
1 parent f3e286b commit c9ee633
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
37 changes: 37 additions & 0 deletions common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,33 @@ location /map/v3/kela/en/ {
proxy_set_header Accept-Language "en";
}

location /map/v3-kela/kela/fi/ {
rewrite /map/v3-kela/kela/fi/(.*) /otp/routers/kela/vectorTiles/$1 break;
proxy_pass http://opentripplanner-kela-v2:8080;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Language "fi";
}

location /map/v3-kela/kela/sv/ {
rewrite /map/v3-kela/kela/sv/(.*) /otp/routers/kela/vectorTiles/$1 break;
proxy_pass http://opentripplanner-kela-v2:8080;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Language "sv";
}

location /map/v3-kela/kela/en/ {
rewrite /map/v3-kela/kela/en/(.*) /otp/routers/kela/vectorTiles/$1 break;
proxy_pass http://opentripplanner-kela-v2:8080;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Language "en";
}

location /graphiql/ {
proxy_pass http://graphiql:8080;
proxy_redirect off;
Expand Down Expand Up @@ -326,6 +353,16 @@ location /routing/v2/routers/kela {
proxy_read_timeout 11500ms;
}

location /routing/v2-kela/routers/kela {
rewrite /routing/v2-kela/(.*) /otp/$1 break;
proxy_pass http://opentripplanner-kela-v2:8080/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Host $host;
proxy_read_timeout 11500ms;
}

location /routing/v2/routers/hsl {
rewrite /routing/v2/(.*) /otp/$1 break;
proxy_pass http://opentripplanner-hsl-v2:8080/;
Expand Down
2 changes: 2 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ describe('api.digitransit.fi', function() {
testProxying('api.digitransit.fi','/map/v3/finland/en/rental-stations/','opentripplanner-finland-v2:8080');
testProxying('api.digitransit.fi','/map/v3/varely/en/stops,stations/','opentripplanner-varely-v2:8080');
testProxying('api.digitransit.fi','/map/v3/waltti-alt/en/rental-stations/','opentripplanner-waltti-alt-v2:8080');
testProxying('api.digitransit.fi','/map/v3-kela/kela/en/rental-stations/','opentripplanner-kela-v2:8080');
testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080');
testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080');
testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080');
testProxying('dev-api.digitransit.fi','/routing/v2/routers/finland','opentripplanner-finland-v2:8080');
testProxying('dev-api.digitransit.fi','/routing/v2/routers/hsl','opentripplanner-hsl-v2:8080');
testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti','opentripplanner-waltti-v2:8080');
testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti-alt','opentripplanner-waltti-alt-v2:8080');
testProxying('dev-api.digitransit.fi','/routing/v2-kela/routers/kela','opentripplanner-kela-v2:8080');
testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080');
testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*');
testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-con-waltti:8080');
Expand Down

0 comments on commit c9ee633

Please sign in to comment.