Run Reviews and Orders embedded in MT scenario

This makes deployment much simpler
This commit is contained in:
Christian Georgi
2022-08-03 16:25:06 +02:00
parent ea989d8496
commit 5bda368169
2 changed files with 9 additions and 2 deletions

View File

@@ -19,4 +19,4 @@ module.exports = cds.server
// For didactic reasons in capire
const { ReviewsService, OrdersService } = cds.requires
if (!ReviewsService.credentials && !OrdersService.credentials) cds.requires.messaging = false
if (!ReviewsService?.credentials && !OrdersService?.credentials) cds.requires.messaging = false

View File

@@ -5,4 +5,11 @@ const proxy = require('@sap/cds-odata-v2-adapter-proxy')
const proxyOpts = global.it ? { target:'auto' } : {} // for tests, set 'auto' to detect port dynamically
cds.on('bootstrap', app => app.use(proxy(proxyOpts)))
module.exports = require('@capire/bookstore/server.js')
module.exports = require('@capire/bookstore/server.js')
// For didactic reasons in capire, run below services embedded
// TODO find a better way to switch this
if (cds.requires.multitenancy) {
cds.requires.OrdersService = null
cds.requires.ReviewsService = null
}