Created
September 27, 2017 02:44
-
-
Save rauljordan/0fa2ce4b175af12ac801f43ad1612654 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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