<commit_before>"use strict";

import * as async from "async";
import { Response, Request, NextFunction, Router } from "express";

import Sequelize from "sequelize";

const sequelize = new Sequelize("js_talks_db", "root", "", {
    host: "localhost",
    dialect: "mysql",
    operatorsAliases: false
});

sequelize.query("SELECT * FROM users").then(datas => {
    console.log("Query result", datas);
});

// const mysql = require('mysql');

// const connection = mysql.createConnection({
//     // port: 3306,
//     host: 'localhost',
//     user: 'root',
//     password: '',
//     database: 'js_talks_db'
// });

// connection.connect();

// connection.query('SELECT * FROM users', (error, results, fields) => {
    // if (error) throw error;
    // console.log('The solution is: ', results);
// });

// connection.end();

// const db = require("../db-mocks.json");

/**
 * GET /api
 * List of API examples.
 */
const router = Router();

// HOME

// router.get("/", (req: Request, res: Response) => {
//     res.json();
// });

// // TALKS

// router.get("/talks", (req: Request, res: Response) => {
//     const err = db.talks ? false : true;
//     if (err) res.status(404).send("Talks not found");
//     res.status(200).send(db.talks);
// });

export default router;<commit_msg>remove sequalize<commit_after>"use strict";

import * as async from "async";
import { Response, Request, NextFunction, Router } from "express";

const db = require("../db-mocks.json");

/**
 * GET /api
 * List of API examples.
 */
const router = Router();

// HOME

router.get("/", (req: Request, res: Response) => {
    res.json();
});

// TALKS

router.get("/talks", (req: Request, res: Response) => {
    const err = db.talks ? false : true;
    if (err) res.status(404).send("Talks not found");
    res.status(200).send(db.talks);
});

export default router;
{'fraction_non_alphanumeric': 0.20616883116883117, 'fraction_numerical': 0.008658008658008658, 'mean_word_length': 3.09070796460177, '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': '5411885', 'n_tokens_mistral': 629, 'n_tokens_neox': 611, 'n_words': 158}