diff --git a/app.js b/app.js index 897bf34..2e1f031 100644 --- a/app.js +++ b/app.js @@ -43,12 +43,22 @@ let root = { }; let app = express(); + +/* leaving this here for reference +app.options('/graphql', function (req, res) { + res.header('Access-Control-Allow-Origin', '*'); + res.header('Access-Control-Allow-Methods', 'GET,POST,OPTIONS'); + res.send(200); +}); +*/ + +app.use(cors()); + app.use('/graphql', graphqlHTTP({ schema: schema, rootValue: root, graphiql: true, })); -app.use(cors()); app.listen(config.port || 4000);