Last active
June 18, 2017 16:33
-
-
Save ivanbtrujillo/9c52af0c35c6bd92a278a78e5b4f275c to your computer and use it in GitHub Desktop.
GraphQL. 03 — Schemas y GraphiQL - 06
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 express = require('express'), | |
expressGraphQL = require('express-graphql'), | |
// Importamos el schema | |
schema = require('./schema/schema'); | |
const app = express(); | |
app.use('/graphql', expressGraphQL({ | |
// Lo pasamos como parámetro | |
schema, | |
graphiql: true | |
})); | |
app.listen(4000, (err, res) => { | |
if (err) | |
console.log(`Error: ${err}`); | |
else | |
console.log('Servidor express funcionando en el puerto 4000') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment