Swagger UI with cds-swagger-ui-express

Moved from `bookshop` to `fiori`, as that one already has a `server.js`
This commit is contained in:
Christian Georgi
2021-07-05 17:34:49 +02:00
parent 82d6f54337
commit 97670bbc84
5 changed files with 10 additions and 74 deletions

View File

@@ -1,4 +1,5 @@
const cds = require ('@sap/cds')
module.exports = cds.server
cds.once('bootstrap',(app)=>{
app.use ('/orders/webapp', _from('@capire/orders/app/orders/webapp/manifest.json'))
@@ -8,7 +9,11 @@ cds.once('bootstrap',(app)=>{
cds.once('served', require('./srv/mashup'))
module.exports = cds.server
// Swagger UI - see https://cap.cloud.sap/docs/advanced/openapi
if (process.env.NODE_ENV !== 'production') {
const cds_swagger = require ('cds-swagger-ui-express')
cds.once ('bootstrap', app => app.use (cds_swagger()) )
}
// -----------------------------------------------------------------------