From 9536a7f34c51c27fff58599b4662a5cae9c15ecb Mon Sep 17 00:00:00 2001 From: sjvans <30337871+sjvans@users.noreply.github.com> Date: Fri, 4 Mar 2022 12:57:35 +0100 Subject: [PATCH] rm server.js (#327) --- graphql/server.js | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 graphql/server.js diff --git a/graphql/server.js b/graphql/server.js deleted file mode 100644 index c80699b9..00000000 --- a/graphql/server.js +++ /dev/null @@ -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