<commit_before>import bodyParser from 'body-parser';
import connectRedis from 'connect-redis';
import cors from 'cors';
import express from 'express';
import session from 'express-session';
import mongoose from 'mongoose';
import redis from 'redis';

import { DB_URI, PORT, REDIS_PORT, SESSION_SECRET } from './config';
import { UserModel } from './users';
import authMiddleware from './middleware/auth';

const app = express();

// connect to mongodb database
mongoose.Promise = global.Promise;
mongoose.connect(DB_URI);

// setup redis session store
const RedisStore = connectRedis(session);

// setup express middleware
app.use(cors({ 
    credentials: true,
    origin: 'http://localhost:8080',
}));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());<commit_msg>Update server CORs origin<commit_after>import bodyParser from 'body-parser';
import connectRedis from 'connect-redis';
import cors from 'cors';
import express from 'express';
import session from 'express-session';
import mongoose from 'mongoose';
import redis from 'redis';

import { DB_URI, PORT, REDIS_PORT, SESSION_SECRET } from './config';
import { UserModel } from './users';
import authMiddleware from './middleware/auth';

const app = express();

// connect to mongodb database
mongoose.Promise = global.Promise;
mongoose.connect(DB_URI);

// setup redis session store
const RedisStore = connectRedis(session);

// setup express middleware
app.use(cors({ 
    credentials: true,
    origin: 'http://localhost:4000',
}));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
{'fraction_non_alphanumeric': 0.13341645885286782, 'fraction_numerical': 0.004987531172069825, 'mean_word_length': 5.42, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '758556', 'n_tokens_mistral': 486, 'n_tokens_neox': 486, 'n_words': 146}