Got it working!

This commit is contained in:
2020-03-16 06:31:29 +11:00
parent a985e496a8
commit e9655f1055
3 changed files with 95 additions and 11 deletions

View File

@@ -12,12 +12,12 @@ const simpleQL = require('./simpleQL');
const simple = simpleQL(schema, handler);
//open the end
app.post('/simpleql', (req, res) => {
const [code, result] = simple(req.body);
res.status(code).send(result);
app.post('/simpleql', async (req, res) => {
const [code, result] = await simple(req.body);
res.status(code).send(result);
});
//startup
app.listen(process.env.WEB_PORT || 3100, err => {
console.log(`listening to *:${process.env.WEB_PORT || 3100}`);
console.log(`listening to *:${process.env.WEB_PORT || 3100}`);
});