Skip to content

Commit

Permalink
remove bookshop service, rename app router directory
Browse files Browse the repository at this point in the history
  • Loading branch information
vl-leon committed Dec 20, 2024
1 parent 44088c6 commit b396108
Show file tree
Hide file tree
Showing 14 changed files with 8 additions and 201 deletions.
1 change: 1 addition & 0 deletions app-router/bookshop
1 change: 1 addition & 0 deletions app-router/orders
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions app-router/reviews
24 changes: 3 additions & 21 deletions app/router/xs-app.json → app-router/xs-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
{
"source": "^/admin/(.*)$",
"target": "/admin/$1",
"destination": "bookshop-api",
"destination": "bookstore-api",
"csrfProtection": true
},
{
"source": "^/browse/(.*)$",
"target": "/browse/$1",
"destination": "bookshop-api",
"destination": "bookstore-api",
"csrfProtection": true
},
{
"source": "^/user/(.*)$",
"target": "/user/$1",
"destination": "bookshop-api",
"destination": "bookstore-api",
"csrfProtection": true
},
{
Expand All @@ -41,24 +41,6 @@
"destination": "reviews-api",
"csrfProtection": true
},
{
"source": "^/mashup/admin/(.*)$",
"target": "/admin/$1",
"destination": "bookstore-api",
"csrfProtection": true
},
{
"source": "^/mashup/browse/(.*)$",
"target": "/browse/$1",
"destination": "bookstore-api",
"csrfProtection": true
},
{
"source": "^/mashup/user/(.*)$",
"target": "/user/$1",
"destination": "bookstore-api",
"csrfProtection": true
},
{
"source": "^(.*)$",
"target": "$1",
Expand Down
1 change: 0 additions & 1 deletion app/router/bookshop

This file was deleted.

1 change: 0 additions & 1 deletion app/router/orders

This file was deleted.

1 change: 0 additions & 1 deletion app/router/reviews

This file was deleted.

File renamed without changes.
3 changes: 1 addition & 2 deletions bookstore/srv/mashup.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ module.exports = async()=>{ // called by server.js
//
// Create an order with the OrdersService when CatalogService signals a new order
//
const messaging = await cds.connect.to('messaging')
messaging.on('CatalogService.OrderedBook', async (msg) => {
CatalogService.on('OrderedBook', async (msg) => {
const { book, quantity, buyer } = msg.data
const { title, price } = await db.read (Books, book, b => { b.title, b.price })
return OrdersService.create ('OrdersNoDraft').entries({
Expand Down
139 changes: 0 additions & 139 deletions db/src/.hdiconfig

This file was deleted.

7 changes: 0 additions & 7 deletions db/undeploy.json

This file was deleted.

30 changes: 1 addition & 29 deletions mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,10 @@ build-parameters:
commands:
- npm ci
- npx cds build --for hana --production --ws
- npx cds build ./bookshop --for nodejs --production --ws-pack
- npx cds build ./orders --for nodejs --production --ws-pack
- npx cds build ./reviews --for nodejs --production --ws-pack
- npx cds build ./bookstore --for nodejs --production --ws-pack
modules:
- name: bookshop-srv
type: nodejs
path: bookshop/gen/srv
parameters:
buildpack: nodejs_buildpack
readiness-health-check-type: http
readiness-health-check-http-endpoint: /health
disk-quota: 256M
memory: 256M
build-parameters:
builder: npm
provides:
- name: bookshop-api
properties:
srv-url: ${default-url}
requires:
- name: samples-messaging
- name: samples-db
- name: samples-auth

- name: orders-srv
type: nodejs
path: orders/gen/srv
Expand Down Expand Up @@ -106,18 +85,12 @@ modules:

- name: samples
type: approuter.nodejs
path: app/router
path: app-router
parameters:
keep-existing-routes: true
disk-quota: 256M
memory: 256M
requires:
- name: bookshop-api
group: destinations
properties:
name: bookshop-api # must be used in xs-app.json as well
url: ~{srv-url}
forwardAuthToken: true
- name: orders-api
group: destinations
properties:
Expand All @@ -141,7 +114,6 @@ modules:
- name: destination-content
type: com.sap.application.content
requires:
- name: bookshop-api
- name: orders-api
- name: reviews-api
- name: bookstore-api
Expand Down

0 comments on commit b396108

Please sign in to comment.