Skip to content

Instantly share code, notes, and snippets.

@rauljordan
Created September 27, 2017 02:44
Show Gist options
  • Save rauljordan/0fa2ce4b175af12ac801f43ad1612654 to your computer and use it in GitHub Desktop.
Save rauljordan/0fa2ce4b175af12ac801f43ad1612654 to your computer and use it in GitHub Desktop.
import express from 'express';
import cors from 'cors';
import graphqlHTTP from 'express-graphql';
import schema from './schema';
const app = express();
app.use(cors());
app.use('/', (req, res) => {
graphqlHTTP({
schema: schema,
pretty: true,
graphiql: true,
})(req, res);
});
const port = 3010;
app.listen(port, () => {
console.log(`app started on port ${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment