Skip to content

Commit

Permalink
Better error message if modules are not found (#750)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Christian Georgi <[email protected]>
Co-authored-by: Daniel Schlachter <[email protected]>
Co-authored-by: Andre Meyering <[email protected]>
  • Loading branch information
4 people authored Aug 7, 2024
1 parent e6358b5 commit cf7506f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bookstore/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ cds.once('served', require('./srv/mashup'))

// Add routes to UIs from imported packages
cds.once('bootstrap',(app)=>{
app.serve ('/bookshop') .from ('@capire/bookshop','app/vue')
app.serve ('/reviews') .from ('@capire/reviews','app/vue')
app.serve ('/orders') .from('@capire/orders','app/orders')
app.serve ('/data') .from('@capire/data-viewer','app/viewer')
try {
app.serve ('/bookshop') .from ('@capire/bookshop','app/vue')
app.serve ('/reviews') .from ('@capire/reviews','app/vue')
app.serve ('/orders') .from('@capire/orders','app/orders')
app.serve ('/data') .from('@capire/data-viewer','app/viewer')
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND') throw new Error('Run "npm ci" to install the required dependencies', { cause: err })
throw err
}
})

// Add Swagger UI
Expand Down

0 comments on commit cf7506f

Please sign in to comment.