-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
31 lines (24 loc) · 827 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
///////////////////////////////////////////////////////////////
///
/// Code by Greg K Limo
/// Visit www.greglimo.com
/// Feb 2021
///
///__________________************______________________________
const { ApolloServer, gql } = require('apollo-server')
const resolvers = require('./src/graphql/resolvers/index')
const typeDefs = require('./src/graphql/typedefs/index')
const contextMiddleware = require("./auth/auth-check");
/* Running mongoDB connection here */
require('./src/mongo/config')
const PORT = process.env.PORT || 5000;
const server = new ApolloServer({
typeDefs,
resolvers,
introspection: true,
playground: true,
context: contextMiddleware,
})
server.listen(PORT).then(({ url })=>{
console.log(`🚀 Server ready at ${url}`);
})