{"size": 483, "ext": "js", "max_stars_repo_path": "api/server/index.js", "max_stars_repo_name": "gk95/NightLux", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "api/server/index.js", "max_issues_repo_name": "gk95/NightLux", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "api/server/index.js", "max_forks_repo_name": "gk95/NightLux", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.15, "max_line_length": 70, "alphanum_fraction": 0.7287784679}
import express from 'express';
import { graphql, graphiql } from './graphql';
import mongoose from 'mongoose'
import * as config from '../config'

import bodyParser from 'body-parser';

mongoose.Promise = global.Promise;
mongoose.connect(config.db.MONGO_URL, {
  useMongoClient: true,
});

let app = express();

app.use('/graphql', bodyParser.json(), graphql);
app.use('/graphiql', graphiql);

app.listen(4000);
console.log('Running a GraphQL API server at localhost:4000/graphql');
