<commit_before>var express    = require('express');        // call express
var app        = express();                 // define our app using express
var child_process = require('child_process');

var port = process.env.PORT || 8080;        // set our port

// ROUTES FOR OUR API
// =============================================================================
var router = express.Router();              // get an instance of the express Router

// test route to make sure everything is working (accessed at GET http://localhost:8080/api)
router.get('/', function(req, res) {
    res.json({ message: 'API available'});
});

router.get('/exec/:cmd', function(req, res) {
    var output = child_process.execSync(req.params.cmd);
    res.send(output);
});<commit_msg>Don't run the spawned program in a shell.<commit_after>var express    = require('express');        // call express
var app        = express();                 // define our app using express
var child_process = require('child_process');

var port = process.env.PORT || 8080;        // set our port

// ROUTES FOR OUR API
// =============================================================================
var router = express.Router();              // get an instance of the express Router

// test route to make sure everything is working (accessed at GET http://localhost:8080/api)
router.get('/', function(req, res) {
    res.json({ message: 'API available'});
});

router.get('/exec/:cmd', function(req, res) {
    var ret = child_process.spawnSync(req.params.cmd);
    res.send(ret.stdout);
});
{'fraction_non_alphanumeric': 0.22727272727272727, 'fraction_numerical': 0.010243277848911651, 'mean_word_length': 3.2243243243243245, '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': '4539346', 'n_tokens_mistral': 422, 'n_tokens_neox': 400, 'n_words': 133}