remove bookshop service, rename app router directory

This commit is contained in:
Vladislav Leonkev
2024-12-20 15:52:13 +01:00
parent 44088c63c8
commit 480a16dfa2
14 changed files with 8 additions and 201 deletions

1
app-router/bookshop Symbolic link
View File

@@ -0,0 +1 @@
../bookshop/app/vue

1
app-router/orders Symbolic link
View File

@@ -0,0 +1 @@
../orders/app/orders

1
app-router/reviews Symbolic link
View File

@@ -0,0 +1 @@
../reviews/app/vue

View File

@@ -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
},
{
@@ -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",

View File

@@ -1 +0,0 @@
../../bookshop/app/vue

View File

@@ -1 +0,0 @@
../../orders/app/orders

View File

@@ -1 +0,0 @@
../../reviews/app/vue

View File

@@ -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({

View File

@@ -1,139 +0,0 @@
{
"file_suffixes": {
"csv": {
"plugin_name": "com.sap.hana.di.tabledata.source"
},
"hdbafllangprocedure": {
"plugin_name": "com.sap.hana.di.afllangprocedure"
},
"hdbanalyticprivilege": {
"plugin_name": "com.sap.hana.di.analyticprivilege"
},
"hdbcalculationview": {
"plugin_name": "com.sap.hana.di.calculationview"
},
"hdbcollection": {
"plugin_name": "com.sap.hana.di.collection"
},
"hdbconstraint": {
"plugin_name": "com.sap.hana.di.constraint"
},
"hdbdropcreatetable": {
"plugin_name": "com.sap.hana.di.dropcreatetable"
},
"hdbflowgraph": {
"plugin_name": "com.sap.hana.di.flowgraph"
},
"hdbfunction": {
"plugin_name": "com.sap.hana.di.function"
},
"hdbgraphworkspace": {
"plugin_name": "com.sap.hana.di.graphworkspace"
},
"hdbhadoopmrjob": {
"plugin_name": "com.sap.hana.di.virtualfunctionpackage.hadoop"
},
"hdbindex": {
"plugin_name": "com.sap.hana.di.index"
},
"hdblibrary": {
"plugin_name": "com.sap.hana.di.library"
},
"hdbmigrationtable": {
"plugin_name": "com.sap.hana.di.table.migration"
},
"hdbprocedure": {
"plugin_name": "com.sap.hana.di.procedure"
},
"hdbprojectionview": {
"plugin_name": "com.sap.hana.di.projectionview"
},
"hdbprojectionviewconfig": {
"plugin_name": "com.sap.hana.di.projectionview.config"
},
"hdbreptask": {
"plugin_name": "com.sap.hana.di.reptask"
},
"hdbresultcache": {
"plugin_name": "com.sap.hana.di.resultcache"
},
"hdbrole": {
"plugin_name": "com.sap.hana.di.role"
},
"hdbroleconfig": {
"plugin_name": "com.sap.hana.di.role.config"
},
"hdbsearchruleset": {
"plugin_name": "com.sap.hana.di.searchruleset"
},
"hdbsequence": {
"plugin_name": "com.sap.hana.di.sequence"
},
"hdbstatistics": {
"plugin_name": "com.sap.hana.di.statistics"
},
"hdbstructuredprivilege": {
"plugin_name": "com.sap.hana.di.structuredprivilege"
},
"hdbsynonym": {
"plugin_name": "com.sap.hana.di.synonym"
},
"hdbsynonymconfig": {
"plugin_name": "com.sap.hana.di.synonym.config"
},
"hdbsystemversioning": {
"plugin_name": "com.sap.hana.di.systemversioning"
},
"hdbtable": {
"plugin_name": "com.sap.hana.di.table"
},
"hdbtabledata": {
"plugin_name": "com.sap.hana.di.tabledata"
},
"hdbtabletype": {
"plugin_name": "com.sap.hana.di.tabletype"
},
"hdbtrigger": {
"plugin_name": "com.sap.hana.di.trigger"
},
"hdbview": {
"plugin_name": "com.sap.hana.di.view"
},
"hdbvirtualfunction": {
"plugin_name": "com.sap.hana.di.virtualfunction"
},
"hdbvirtualfunctionconfig": {
"plugin_name": "com.sap.hana.di.virtualfunction.config"
},
"hdbvirtualpackagehadoop": {
"plugin_name": "com.sap.hana.di.virtualpackage.hadoop"
},
"hdbvirtualpackagesparksql": {
"plugin_name": "com.sap.hana.di.virtualpackage.sparksql"
},
"hdbvirtualprocedure": {
"plugin_name": "com.sap.hana.di.virtualprocedure"
},
"hdbvirtualprocedureconfig": {
"plugin_name": "com.sap.hana.di.virtualprocedure.config"
},
"hdbvirtualtable": {
"plugin_name": "com.sap.hana.di.virtualtable"
},
"hdbvirtualtableconfig": {
"plugin_name": "com.sap.hana.di.virtualtable.config"
},
"properties": {
"plugin_name": "com.sap.hana.di.tabledata.properties"
},
"tags": {
"plugin_name": "com.sap.hana.di.tabledata.properties"
},
"txt": {
"plugin_name": "com.sap.hana.di.copyonly"
},
"hdbeshconfig": {
"plugin_name": "com.sap.hana.di.eshconfig"
}
}
}

View File

@@ -1,7 +0,0 @@
[
"src/gen/**/*.hdbview",
"src/gen/**/*.hdbindex",
"src/gen/**/*.hdbconstraint",
"src/gen/**/*_drafts.hdbtable",
"src/gen/**/*.hdbcalculationview"
]

View File

@@ -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
@@ -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:
@@ -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