<commit_before>/* globals Promise */

import mongoose from 'mongoose'
import express from 'express'
import bodyParser from 'body-parser'
import { MONGO_URL, PORT } from './config'
import routes from './routes'

// mongoose
mongoose.Promise = Promise
mongoose.connect(MONGO_URL)

// setup express instance<commit_msg>api: try to reconnect after 5 seconds if the initial connect fails<commit_after>/* globals Promise */

import mongoose from 'mongoose'
import express from 'express'
import bodyParser from 'body-parser'
import { MONGO_URL, PORT } from './config'
import routes from './routes'

// mongoose
mongoose.Promise = Promise
const connect = () => (
  mongoose.connect(MONGO_URL, (err) => {
    if (err != null) {
      setTimeout(connect, 5000)
    }
  })
)
connect()

// setup express instance
{'fraction_non_alphanumeric': 0.1175, 'fraction_numerical': 0.00625, 'mean_word_length': 4.201298701298701, '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': '3779282', 'n_tokens_mistral': 244, 'n_tokens_neox': 247, 'n_words': 81}