<commit_before>import express from 'express';
import { Server } from 'http';
import bodyParser from 'body-parser';
import morgan from 'morgan';
import cors from 'cors';
import passport from 'passport';
import { userRoutes } from './modules';

// Configurations
import './config/envConfig';
import './config/dbConfig';

// Envvars
const port = process.env.PORT;
const mode = process.env.NODE_ENV;

export const app = express();

// Middleware
app.use((req, res, next) => {
  res.header('Access-Control-Allow-Origin', port);
  res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
  res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials'); // eslint-disable-line
  res.header('Access-Control-Allow-Credentials', 'true');
  next();
});
app.use((err, req, res, next) => {
  if (res.headersSent) {
    return next(err);
  }

  return res.status(err.status || port).render('500');
});
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(morgan('dev'));
app.use(cors());
app.use(passport.initialize());

// Routing
app.use('/api/v1', [userRoutes]);

// Express Server
const server = Server(app);
server.listen(port, err => {
  if (err) console.log(`Error happned: ${err}`);
  console.log(`Server listening on http://localhost:${port} in ${mode}.`);
});<commit_msg>updated export<commit_after>import express from 'express';
import { Server } from 'http';
import bodyParser from 'body-parser';
import morgan from 'morgan';
import cors from 'cors';
import passport from 'passport';
import { userRoutes } from './modules';

// Configurations
import './config/envConfig';
import './config/dbConfig';

// Envvars
const port = process.env.PORT;
const mode = process.env.NODE_ENV;

const app = express();

// Middleware
app.use((req, res, next) => {
  res.header('Access-Control-Allow-Origin', port);
  res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
  res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials'); // eslint-disable-line
  res.header('Access-Control-Allow-Credentials', 'true');
  next();
});
app.use((err, req, res, next) => {
  if (res.headersSent) {
    return next(err);
  }

  return res.status(err.status || port).render('500');
});
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(morgan('dev'));
app.use(cors());
app.use(passport.initialize());

// Routing
app.use('/api/v1', [userRoutes]);

// Express Server
export const server = Server(app);
server.listen(port, err => {
  if (err) console.log(`Error happned: ${err}`);
  console.log(`Server listening on http://localhost:${port} in ${mode}.`);
});
{'fraction_non_alphanumeric': 0.19152723389106444, 'fraction_numerical': 0.002847988608045568, 'mean_word_length': 4.953389830508475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6736830', 'n_tokens_mistral': 912, 'n_tokens_neox': 911, 'n_words': 213}