diff --git a/app/router/bookshop b/app/router/bookshop new file mode 120000 index 00000000..a1eee5cc --- /dev/null +++ b/app/router/bookshop @@ -0,0 +1 @@ +../bookshop/app/vue \ No newline at end of file diff --git a/app/router/orders b/app/router/orders new file mode 120000 index 00000000..b386dc38 --- /dev/null +++ b/app/router/orders @@ -0,0 +1 @@ +../orders/app/orders \ No newline at end of file diff --git a/app/router/reviews b/app/router/reviews new file mode 120000 index 00000000..6842f93a --- /dev/null +++ b/app/router/reviews @@ -0,0 +1 @@ +../reviews/app/vue \ No newline at end of file diff --git a/app/router/xs-app.json b/app/router/xs-app.json index 9b3772bc..ffd1574e 100644 --- a/app/router/xs-app.json +++ b/app/router/xs-app.json @@ -1,10 +1,47 @@ { + "welcomeFile": "app/bookshop/index.html", "routes": [ { - "source": "^/(.*)$", - "target": "$1", - "destination": "srv-api", + "source": "^/app/(.*)$", + "target": "$1", + "localDir": ".", + "cacheControl": "no-cache, no-store, must-revalidate" + }, + { + "source": "^(.*)$", + "target": "$1", + "localDir": ".", + "cacheControl": "no-cache, no-store, must-revalidate" + }, + { + "source": "^/admin/(.*)$", + "target": "/admin/$1", + "destination": "bookstore-api", "csrfProtection": true - } + }, + { + "source": "^/browse/(.*)$", + "target": "/browse/$1", + "destination": "bookstore-api", + "csrfProtection": true + }, + { + "source": "^/user/(.*)$", + "target": "/user/$1", + "destination": "bookstore-api", + "csrfProtection": true + }, + { + "source": "^/odata/v4/orders/(.*)$", + "target": "/odata/v4/orders/$1", + "destination": "orders-api", + "csrfProtection": true + }, + { + "source": "^/reviews/(.*)$", + "target": "/reviews/$1", + "destination": "reviews-api", + "csrfProtection": true + } ] } diff --git a/mta.yaml b/mta.yaml index 917b58d4..501c9c0a 100644 --- a/mta.yaml +++ b/mta.yaml @@ -44,12 +44,24 @@ modules: disk-quota: 256M memory: 256M requires: - - name: srv-api - group: destinations - properties: - name: srv-api # must be used in xs-app.json as well - url: ~{srv-url} - forwardAuthToken: true + - name: orders-api + group: destinations + properties: + name: orders-api + url: ~{srv-url} + forwardAuthToken: true + - name: reviews-api + group: destinations + properties: + name: reviews-api + url: ~{srv-url} + forwardAuthToken: true + - name: bookstore-api + group: destinations + properties: + name: bookstore-api + url: ~{srv-url} + forwardAuthToken: true provides: - name: app-api properties: