feat: client retrieves data from GraphQL

This commit is contained in:
Joshua Seigler 2020-01-31 00:54:13 -05:00
parent 7bc3484b71
commit c333883162
9 changed files with 85 additions and 8 deletions

View file

@ -1,5 +1,6 @@
const express = require('express');
const graphqlHTTP = require('express-graphql');
const cors = require('cors');
const mongoose = require('mongoose');
require('dotenv-safe').config();
@ -15,6 +16,8 @@ mongoose.connection.once('open', () => {
console.log('Connected to database.');
});
app.use(cors({ origin: 'http://localhost:1234' }));
app.use('/graphql', graphqlHTTP({
schema,
graphiql: true