Skip to content

Commit

Permalink
add destinations for bookstore
Browse files Browse the repository at this point in the history
  • Loading branch information
vl-leon committed Dec 9, 2024
1 parent 32b0e82 commit a92a33c
Show file tree
Hide file tree
Showing 4 changed files with 568 additions and 19 deletions.
14 changes: 12 additions & 2 deletions bookstore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,28 @@
"@capire/orders": "*",
"@capire/common": "*",
"@capire/data-viewer": "*",
"@sap-cloud-sdk/http-client": "^3.24.0",
"@sap-cloud-sdk/resilience": "^3.24.0",
"@sap/cds": ">=5",
"express": "^4.17.1"
},
"cds": {
"requires": {
"ReviewsService": {
"kind": "odata",
"model": "@capire/reviews"
"model": "@capire/reviews",
"credentials": {
"destination": "reviews-dest",
"path": "/reviews"
}
},
"OrdersService": {
"kind": "odata",
"model": "@capire/orders"
"model": "@capire/orders",
"credentials": {
"destination": "orders-dest",
"path": "/odata/v4/orders"
}
},
"[production]": {
"auth": "xsuaa",
Expand Down
49 changes: 49 additions & 0 deletions mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ modules:
readiness-health-check-http-endpoint: /health
disk-quota: 256M
memory: 256M
destination-name: bookshop-dest
build-parameters:
builder: npm
provides:
- name: bookshop-api
properties:
srv-url: ${default-url}
destination: ${destination-name}
requires:
- name: samples-messaging
- name: samples-db
Expand All @@ -44,12 +46,14 @@ modules:
readiness-health-check-http-endpoint: /health
disk-quota: 256M
memory: 256M
destination-name: orders-dest
build-parameters:
builder: npm
provides:
- name: orders-api
properties:
srv-url: ${default-url}
destination: ${destination-name}
requires:
- name: samples-messaging
- name: samples-db
Expand All @@ -64,12 +68,14 @@ modules:
readiness-health-check-http-endpoint: /health
disk-quota: 256M
memory: 256M
destination-name: reviews-dest
build-parameters:
builder: npm
provides:
- name: reviews-api
properties:
srv-url: ${default-url}
destination: ${destination-name}
requires:
- name: samples-messaging
- name: samples-db
Expand Down Expand Up @@ -136,6 +142,44 @@ modules:
url: ~{srv-url}
forwardAuthToken: true
- name: samples-auth
- name: samples-destination

- name: destination-content
type: com.sap.application.content
requires:
- name: bookshop-api
- name: orders-api
- name: reviews-api
- name: bookstore-api
- name: samples-auth
parameters:
service-key:
name: xsuaa_service-key
- name: samples-destination
parameters:
content-target: true
build-parameters:
no-source: true
parameters:
content:
instance:
existing_destinations_policy: update
destinations:
- Name: ~{bookshop-api/destination}
URL: ~{bookshop-api/srv-url}
Authentication: OAuth2ClientCredentials
TokenServiceInstanceName: samples-auth
TokenServiceKeyName: xsuaa_service-key
- Name: ~{orders-api/destination}
URL: ~{orders-api/srv-url}
Authentication: OAuth2ClientCredentials
TokenServiceInstanceName: samples-auth
TokenServiceKeyName: xsuaa_service-key
- Name: ~{reviews-api/destination}
URL: ~{reviews-api/srv-url}
Authentication: OAuth2ClientCredentials
TokenServiceInstanceName: samples-auth
TokenServiceKeyName: xsuaa_service-key

resources:
- name: samples-messaging
Expand All @@ -160,3 +204,8 @@ resources:
config:
xsappname: samples-${org}-${space}
tenant-mode: dedicated
- name: samples-destination
type: org.cloudfoundry.managed-service
parameters:
service: destination
service-plan: lite
Loading

0 comments on commit a92a33c

Please sign in to comment.