<commit_before>import bodyParser from "body-parser"
import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
import mongoose from "mongoose"
import schema from "./graphql"
import Items from "./db/item"
import Updates from "./db/update"

// Constants
const CONFIG = require("./settings.yaml")

const app = express()

mongoose.Promise = global.Promise
mongoose.connect(
  `mongodb://${CONFIG.mongodb.url}:${CONFIG.mongodb.port}/${CONFIG.mongodb
    .database}`,
  {
    useMongoClient: true
  }
)
mongoose.set("debug", true)

app.use(
  "/graphql",
  bodyParser.json({
    limit: "15mb"
  }),
  graphqlExpress(req => {
    return {
      schema,
      context: {
        loaders: {},
        models: {
          items: Items,
          updates: Updates
        }
      }
    }
  })
)

app.use(
  "/graphiql",
  graphiqlExpress({
    endpointURL: "/graphql"
  })
)
<commit_msg>Remove mongoose connection from server module<commit_after>import bodyParser from "body-parser"
import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
import mongoose from "mongoose"
import schema from "./graphql"
import Items from "./db/item"
import Updates from "./db/update"

// Constants
const CONFIG = require("./settings.yaml")

const app = express()
app.use(
  "/graphql",
  bodyParser.json({
    limit: "15mb"
  }),
  graphqlExpress(req => {
    return {
      schema,
      context: {
        loaders: {},
        models: {
          items: Items,
          updates: Updates
        }
      }
    }
  })
)

app.use(
  "/graphiql",
  graphiqlExpress({
    endpointURL: "/graphql"
  })
)

{'fraction_non_alphanumeric': 0.13623354321694334, 'fraction_numerical': 0.0022896393817973667, 'mean_word_length': 2.9192825112107625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1491877', 'n_tokens_mistral': 571, 'n_tokens_neox': 570, 'n_words': 134}