Created
September 10, 2019 10:26
-
-
Save tkssharma/d30621201f89cd04edad1de91fe7c443 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const app = express(); | |
app.use(bodyParser.json()); | |
app.use( | |
'/graphql', | |
graphqlHttp({ | |
schema: graphQlSchema, | |
rootValue: graphQlResolvers, | |
graphiql: true | |
}) | |
); | |
mongoose | |
.connect( | |
`mongodb+srv://${process.env.MONGO_USER}:${ | |
process.env.MONGO_PASSWORD | |
}@cluster0-ntrwp.mongodb.net/${process.env.MONGO_DB}?retryWrites=true` | |
) | |
.then(() => { | |
app.listen(8000); | |
}) | |
.catch(err => { | |
console.log(err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment