rm server.js (#327)

This commit is contained in:
sjvans
2022-03-04 12:57:35 +01:00
committed by GitHub
parent 079620463f
commit 9536a7f34c

View File

@@ -1,20 +0,0 @@
const cds = require('@sap/cds')
// redeploy the db incl. initial data for demo purposes
cds.on('bootstrap', app => {
app.post('/redeploy', async (req, res) => {
await cds.deploy('*')
res.status(204).end()
})
})
// fix cds.context not being set correctly in GraphQL adapter
cds.on('serving', srv => {
const { dispatch } = srv
srv.dispatch = function(req) {
if (!(cds.context instanceof cds.Request)) cds.context = this
return dispatch.call(this, req)
}
})
module.exports = cds.server