diff --git a/bookstore/server.js b/bookstore/server.js index 15a41c60..26f5d843 100644 --- a/bookstore/server.js +++ b/bookstore/server.js @@ -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 diff --git a/fiori/server.js b/fiori/server.js index 70cf701b..41112772 100644 --- a/fiori/server.js +++ b/fiori/server.js @@ -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') \ No newline at end of file +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 +} \ No newline at end of file