Improved and documented server.js

This commit is contained in:
Daniel
2020-04-12 06:15:23 +02:00
parent 93f4cd5c6e
commit 31357cde95

View File

@@ -35,15 +35,15 @@ cds.once('served', async()=>{
// Other bootstrapping events you could hook in to... // Other bootstrapping events you could hook in to...
/* eslint-disable no-unused-vars */ /* eslint-disable no-unused-vars */
cds.on('loaded', (model) => {/* ... */}) cds.on('loaded', (model) => {/* ... */})
cds.on('serving', (srv) => {/* ... */})
cds.on('connect', (srv) => {/* ... */}) cds.on('connect', (srv) => {/* ... */})
cds.on('serving', (srv) => {/* ... */})
cds.once('listening', ({server,url}) => {/* ... */}) cds.once('listening', ({server,url}) => {/* ... */})
// Delegate bootstrapping to built-in server.js // Delegate bootstrapping to built-in server.js
module.exports = cds.server module.exports = cds.server
// Monkey patching older releases // Monkey-patching older releases
if (cds.version < '3.33.4') cds.once('listening', ()=> cds.emit('served')) if (cds.version < '3.33.4') cds.once('listening', ()=> cds.emit('served'))
// Launch server if started directly from command-line // Launch server if started directly from command-line