Completed
Push — master ( 47688d...46de2c )
by Maxence
01:01
created

app.js (2 issues)

1
import express from 'express';
2
import graphqlHTTP from 'express-graphql';
3
import mongoose from 'mongoose';
4
mongoose.Promise = global.Promise;
5
6
import schema from './graphql';
7
8
var app = express();
9
10
// GraphqQL server route
11
app.use('/graphql', graphqlHTTP(req => ({
0 ignored issues
show
The parameter req is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
12
  schema,
13
  pretty: true,
14
  graphiql: true
15
})));
16
17
// Connect mongo database
18
mongoose.connect('mongodb://localhost/graphql');
19
20
// start server
21
let server = app.listen(4000, function () {
22
  var host = server.address().address;
23
  var port = server.address().port;
24
25
  console.log('GraphQL listening at http://%s:%s', host, port);
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
26
});
27
28
export default server;
29