Last active
June 5, 2018 11:02
-
-
Save daniele-zurico/7089cd76786961975a68e090398232db 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
const MONGO_PORT = 27017; | |
const MONGO_URL = "localhost"; | |
const dbName = "graphExample"; | |
// help to debug mongoose | |
mongoose.set("debug", true); | |
mongoose.connect(`mongodb://${MONGO_URL}:${MONGO_PORT}/${dbName}`); | |
const app = express(); | |
const schema: GraphQLSchema = mergeSchemas({ | |
schemas, | |
resolvers | |
}); | |
// GraphQL | |
const server = new ApolloServer({ | |
schema, | |
context: async (req: any) => { | |
// If we want to put some restriction | |
} | |
}); | |
server.listen().then(({ url }) => { | |
console.log(`🚀 Server ready at ${url}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment