-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathserver.js
More file actions
22 lines (20 loc) · 761 Bytes
/
server.js
File metadata and controls
22 lines (20 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const { ApolloServer } = require('apollo-server'),
config = require('./config'),
migrationsManager = require('./migrations'),
logger = require('./app/logger'),
schema = require('./app/graphql');
const port = config.common.api.port || 8080;
migrationsManager
.check()
.then(() =>
/* const rollbar = new Rollbar({
accessToken: config.common.rollbar.accessToken,
enabled: !!config.common.rollbar.accessToken,
environment: config.common.rollbar.environment || config.environment
}); */
new ApolloServer({ schema }).listen(port).then(({ url, subscriptionsUrl }) => {
logger.info(`🚀 Server ready at ${url}`);
logger.info(`🚀 Subscriptions ready at ${subscriptionsUrl}`);
})
)
.catch(logger.error);