<commit_before>const path = require('path'),
    express = require('express'),
    async = require('async'),
    cp = require('child_process'),
    router = express.Router(),
    lib = require('../lib');

/* GET home page. */
router.get('/', (req, res, next) => {
  res.render('index', { title: 'Express' });
});

router.get('/api', (req, res) => {
    /**
     * Gets data from req.query, 2 important keys here
     * topic - The topic to pull for
     * count - The number of tweets to process
     */
    const worker = cp.fork(path.join(__dirname, "../lib/worker"), [JSON.stringify({topic: req.query.topic, count: req.query.count})]);
    worker.on("message", (m) => {
        if(m == "exit") {
            worker.send("exit");
        }
    });

    res.send({status: true});
});

router.get('/:slug', (req, res) => {

});

module.exports = router;<commit_msg>Temporary changes to index.js for merge<commit_after>const path = require('path'),
    express = require('express'),
    async = require('async'),
    base62 = require('base62'),
    cp = require('child_process'),
    router = express.Router(),
    lib = require('../lib');

/* GET home page. */
router.get('/', (req, res, next) => {
  res.render('index', { title: 'Express' });
});

router.get('/api', (req, res) => {
    /**
     * Gets data from req.query, 2 important keys here
     * topic - The topic to pull for
     * count - The number of tweets to process
     */
    const slug = base62.encode(req.query.topic),
        worker = cp.fork(path.join(__dirname, "../lib/worker"), [JSON.stringify({topic: req.query.topic, count: req.query.count})]);
    
    worker.on("message", (m) => {
        if(m == "exit") {
            worker.send("exit");
        }
    });

    res.send({status: true, location: req.sas, slug: slug});
});

router.get('/:slug', (req, res) => {
    const slug = base62.decode(req.params.slug);
    console.log(req.sas);
    res.json(req.sas);
});

module.exports = router;
{'fraction_non_alphanumeric': 0.20528455284552846, 'fraction_numerical': 0.00508130081300813, 'mean_word_length': 2.7720306513409962, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5126075', 'n_tokens_mistral': 644, 'n_tokens_neox': 629, 'n_words': 151}