compose adjustments
This commit is contained in:
18
bookstore/cds-plugin.js
Normal file
18
bookstore/cds-plugin.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
const cds = require ('@sap/cds')
|
||||||
|
|
||||||
|
// Add routes to UIs from imported packages
|
||||||
|
cds.once('bootstrap',(app)=>{
|
||||||
|
app.serve ('/admin-authors') .from ('@capire/fiori','app/admin-authors')
|
||||||
|
app.serve ('/admin-books') .from ('@capire/fiori','app/admin-books')
|
||||||
|
app.serve ('/browse-books') .from ('@capire/fiori','app/browse')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Add mashup logic
|
||||||
|
cds.once('served', require('./srv/mashup'))
|
||||||
|
|
||||||
|
// Add Swagger UI
|
||||||
|
require('./srv/swagger-ui')
|
||||||
|
|
||||||
|
// For didactic reasons in capire
|
||||||
|
const { ReviewsService, OrdersService } = cds.requires
|
||||||
|
if (!ReviewsService?.credentials && !OrdersService?.credentials) cds.requires.messaging = false
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
"@capire/reviews": "*",
|
"@capire/reviews": "*",
|
||||||
"@capire/orders": "*",
|
"@capire/orders": "*",
|
||||||
"@capire/common": "*",
|
"@capire/common": "*",
|
||||||
|
"@capire/fiori": "*",
|
||||||
"@capire/data-viewer": "*",
|
"@capire/data-viewer": "*",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
"express": "^4.17.1"
|
"express": "^4.17.1"
|
||||||
|
|||||||
6
fiori/cds-plugin.js
Normal file
6
fiori/cds-plugin.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
// install OData v2 adapter
|
||||||
|
const cds = require("@sap/cds")
|
||||||
|
const proxy = require('@cap-js-community/odata-v2-adapter')
|
||||||
|
const opts = global.it ? { target:'auto' } : {} // for tests, set 'auto' to detect port dynamically
|
||||||
|
cds.on('bootstrap', app => app.use(proxy(opts))) // install proxy
|
||||||
|
// cds.log('cov2ap','silent') // suppress anoying log outpout, e.g. for `npm run mocha -- --reporter nyan`
|
||||||
@@ -1 +1,8 @@
|
|||||||
|
using from './db/sqlite/index';
|
||||||
|
using from './app/services';
|
||||||
|
using from './app/genres/fiori-service';
|
||||||
|
using from './app/browse/fiori-service';
|
||||||
|
using from './app/admin-books/fiori-service';
|
||||||
|
using from './app/admin-authors/fiori-service';
|
||||||
using from './db/common';
|
using from './db/common';
|
||||||
|
using from './app/common';
|
||||||
@@ -22,6 +22,9 @@
|
|||||||
"kind": "odata",
|
"kind": "odata",
|
||||||
"model": "@capire/orders"
|
"model": "@capire/orders"
|
||||||
},
|
},
|
||||||
|
"self": {
|
||||||
|
"model": "@capire/fiori"
|
||||||
|
},
|
||||||
"messaging": {
|
"messaging": {
|
||||||
"[production]": {
|
"[production]": {
|
||||||
"kind": "enterprise-messaging"
|
"kind": "enterprise-messaging"
|
||||||
|
|||||||
Reference in New Issue
Block a user