<commit_before>// Start using koa2 as normal

import Koa from 'koa';
import Router from 'koa-router';
import logger from 'koa-logger';
import parser from 'koa-body-parser';
import cors from 'kcors';
import queryString from 'query-string';
import apis from './apis';
import passport from './auth';
// koa-convert support will be deprecated in koa v3
import 'koa-convert';

const app = new Koa();
const router = new Router();
app
    .use(cors)
    .use(passport.initialize())
    .use(logger())
    .use(parser())
    .use(router.routes());

router.post('/auth', async (ctx, next) => {
    ctx.body = ctx.state.user;
    // passport.authenticate('local', function(user, info, status) {
    //     console.log('insideeeeeeeeeee');
    //     console.log(user);
    //     if (user === false) {
    //         ctx.status = 401;<commit_msg>-- coorected a typo on usage of kcors middleware<commit_after>// Start using koa2 as normal

import Koa from 'koa';
import Router from 'koa-router';
import logger from 'koa-logger';
import parser from 'koa-body-parser';
import cors from 'kcors';
import queryString from 'query-string';
import apis from './apis';
import passport from './auth';
// koa-convert support will be deprecated in koa v3
import 'koa-convert';

const app = new Koa();
const router = new Router();
app
    .use(cors())
    .use(passport.initialize())
    .use(logger())
    .use(parser())
    .use(router.routes());

router.post('/auth', async (ctx, next) => {
    ctx.body = ctx.state.user;
    // passport.authenticate('local', function(user, info, status) {
    //     console.log('insideeeeeeeeeee');
    //     console.log(user);
    //     if (user === false) {
    //         ctx.status = 401;
{'fraction_non_alphanumeric': 0.16032767700409598, 'fraction_numerical': 0.005851375073142188, 'mean_word_length': 3.1404358353510897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1935432', 'n_tokens_mistral': 569, 'n_tokens_neox': 549, 'n_words': 165}