-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
525 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
FROM node:7-onbuild | ||
|
||
ARG VCS_URL | ||
ARG VCS_REF | ||
ARG BUILD_DATE | ||
|
||
LABEL org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.vcs-url="e.g. https://github.com/schlpbch/bookingAPI" | ||
|
||
LABEL org.label-schema.vendor="SBB" \ | ||
org.label-schema.url="https://www.sbb.ch" \ | ||
org.label-schema.name="bookingAPI" \ | ||
org.label-schema.description="A simple API to book öV tickets in Switzerland." \ | ||
org.label-schema.vcs-url=$VCS_URL \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.build-date=$BUILD_DATE | ||
|
||
CMD npm run prod | ||
EXPOSE 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
/** | ||
* Created by kevinkreuzer on 05.05.17. | ||
*/ | ||
'use strict' | ||
const request = require('request') | ||
const REDIRECT_API = '/redirect_api/' | ||
const createReverseProxy = (app, environmentConfiguration) => { | ||
|
||
const createReverseProxy = (app, backendReise) => { | ||
const proxyRequest = (uri, req, res) => { | ||
request(`${backendReise}/api/${uri}${req.params[0]}${req._parsedUrl.search ? req._parsedUrl.search : ''}`).pipe(res) | ||
const proxyAPIRequest = (clientRequest, clientResponse) => { | ||
let headers = clientRequest.headers | ||
let url = clientRequest.url.replace(REDIRECT_API, `${environmentConfiguration.backendReise}/api/`) | ||
//TODO: Use Certificate solution instead of rejectUnauthorized: false | ||
request(url, {headers, rejectUnauthorized: false}).pipe(clientResponse) | ||
} | ||
app.get('/redirect_api/locations*', function (req, res) { | ||
proxyRequest('locations', req, res) | ||
}) | ||
app.get('/redirect_api/trips*', function (req, res) { | ||
proxyRequest('trips', req, res) | ||
}) | ||
app.get('/redirect_api/offers*', function (req, res) { | ||
proxyRequest('offers', req, res) | ||
}) | ||
app.get('/redirect_api/prebookings*', function (req, res) { | ||
proxyRequest('prebookings', req, res) | ||
|
||
app.get('/redirect_api/*', function(clientRequest, clientResponse){ | ||
proxyAPIRequest(clientRequest, clientResponse) | ||
}) | ||
app.get('/redirect_api/bookings*', function (req, res) { | ||
proxyRequest('bookings', req, res) | ||
|
||
app.get('/basicAuth/login', function (clientRequest, clientResponse) { | ||
let headers = clientRequest.headers | ||
let basicAuthURL = environmentConfiguration.basicAuth_url | ||
//TODO: Use Certificate solution instead of rejectUnauthorized: false | ||
request(basicAuthURL, {headers, rejectUnauthorized: false}, function (request, response) { | ||
if (response.statusCode === 200) { | ||
clientResponse.send(response.headers.authorization) | ||
} | ||
else { | ||
clientResponse.status(401).send({ | ||
message: 'Wrong username or password' | ||
}); | ||
} | ||
}) | ||
}) | ||
} | ||
module.exports = createReverseProxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ const loadEnvironmentConfig = () => { | |
|
||
module.exports = { | ||
loadEnvironmentConfig | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
api-pitch:$apr1$EMjhOYRi$fHpoKIivnsBNUDiatsHcS/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
upstream nodejs_backend { | ||
server mock_server:8080; | ||
server mock_server:8080; | ||
} | ||
|
||
server { | ||
listen 80 default_server; | ||
listen 443 default_server ssl; | ||
listen 80 default_server; | ||
listen 443 default_server ssl; | ||
|
||
ssl_certificate /etc/nginx/ssl/public.pem; | ||
ssl_certificate_key /etc/nginx/ssl/private.pem; | ||
ssl_certificate /etc/nginx/ssl/public.pem; | ||
ssl_certificate_key /etc/nginx/ssl/private.pem; | ||
|
||
client_max_body_size 8k; | ||
charset UTF-8; | ||
client_max_body_size 8k; | ||
charset UTF-8; | ||
|
||
server_name localhost; | ||
location / { | ||
expires 15m; | ||
add_header Pragma public; | ||
add_header Cache-Control "public"; | ||
proxy_pass http://nodejs_backend/; | ||
} | ||
server_name localhost; | ||
location / { | ||
expires 15m; | ||
add_header Pragma public; | ||
add_header Cache-Control "public"; | ||
proxy_pass http://nodejs_backend/; | ||
} | ||
|
||
gzip on; | ||
gzip_comp_level 6; | ||
gzip_min_length 1100; | ||
gzip_buffers 16 8k; | ||
gzip_proxied any; | ||
server_name localhost; | ||
location /app/api-pitch/ { | ||
auth_basic "Restricted Content"; | ||
auth_basic_user_file /etc/nginx/.htpasswd; | ||
expires 1d; | ||
add_header Pragma public; | ||
add_header Cache-Control "public"; | ||
proxy_pass http://nodejs_backend/app/api-pitch/; | ||
} | ||
|
||
gzip on; | ||
gzip_comp_level 6; | ||
gzip_min_length 1100; | ||
gzip_buffers 16 8k; | ||
gzip_proxied any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## Roadmap 2017 R75-R84 | ||
ASC, TAK, DIW (18.05.2017) | ||
|
||
### R75 Deep Link Relase | ||
- journey planning | ||
- get locations | ||
- get trips | ||
- deep linking | ||
- link to webshop B2C | ||
- link to mobile B2C | ||
|
||
### R78 First Light Release | ||
- commercial registration (contract, bill put) | ||
- accounting for trade partners | ||
- accountung for KTU | ||
- picking of booking | ||
|
||
- master data for locations (HD) | ||
|
||
- distribution per tickets (HD) | ||
- via eMail | ||
- via SMS | ||
|
||
- fullfilement | ||
- bar code | ||
- screen ticket | ||
- pass-book (HD) | ||
|
||
- route based distribution (origin, destination, {via}) | ||
- assortment | ||
- City Tickets | ||
- Verbund Tickets | ||
|
||
### R81 Version 1.0 Release | ||
- after sales: | ||
- state of booking e.g., cancelled, printed,... | ||
- refund of a booking | ||
- more than 1 person (child, adult, senior) | ||
- more than 0 vias | ||
- for trips | ||
- for offers | ||
- seat reservation | ||
- fulfilement: | ||
- ticket Layouting for KTUs (print attributes -> ticket) | ||
|
||
### R84 Best Prices Finder Release | ||
- product based distribution | ||
- assortment | ||
- STS passes | ||
- Tageskarte DV (prenom, name, birthday -> ticket) | ||
- RIT | ||
- tailor made ticket | ||
|
||
- best prices per time period | ||
|
||
### R8x Future Releases (not scheduled yet) | ||
- location based trip search | ||
- assortment | ||
- Tageskarte Verbund (prenom, name, birthday -> ticket) | ||
- product information (fares & conditions) | ||
- direct booking | ||
- after sales: exchange | ||
- STS Sortiment | ||
- STS Pass | ||
- STS Flex Pass | ||
- More than 1 person (family fares) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
<md-content layout="column"> | ||
<api-toolbar></api-toolbar> | ||
</md-content> | ||
|
||
<div flex layout="row"> | ||
<api-sidenav></api-sidenav> | ||
<md-content layout-padding flex> | ||
<md-tabs md-dynamic-height md-border-bottom md-selected="$ctrl.tabService.selectedTab"> | ||
<api-travel-wish></api-travel-wish> | ||
<api-connections></api-connections> | ||
<api-offers></api-offers> | ||
<api-prebooking></api-prebooking> | ||
<api-booking></api-booking> | ||
</md-tabs> | ||
<div> | ||
<md-content layout="column"> | ||
<api-toolbar></api-toolbar> | ||
</md-content> | ||
<api-error-log></api-error-log> | ||
</div> | ||
|
||
<div flex layout="row"> | ||
<api-sidenav></api-sidenav> | ||
<md-content layout-padding flex> | ||
<md-tabs md-dynamic-height md-border-bottom md-selected="$ctrl.tabService.selectedTab"> | ||
<api-travel-wish></api-travel-wish> | ||
<api-connections></api-connections> | ||
<api-offers></api-offers> | ||
<api-prebooking></api-prebooking> | ||
<api-booking></api-booking> | ||
</md-tabs> | ||
</md-content> | ||
<api-error-log></api-error-log> | ||
</div> | ||
</div> |
Oops, something went wrong.