<commit_before>"use strict";

/*
 * RESTBase web service entry point
 *
 * Sets up a restbase instance by loading and setting up handlers and the
 * storage layer, and then dispatches requests to it.
 */

if (!global.Promise) {
    global.Promise = require('bluebird');
} else if (!Promise.promisify) {
    // Node 0.11+
    Promise.promisify = require('bluebird').promisify;
}
var rbUtil = require('./rbUtil');
var proxyHandler = require('./proxyHandler');
var Restbase = require('./restbase');
var http = require('http');
var fs = require('fs');
var RouteSwitch = require('routeswitch');

var app = {
    // The global proxy object
    proxy: null
};

function handleResponse (opts, newReq, resp, response) {
    //console.log('resp', response);
    if (response && response.status) {
        if (!response.headers) {
            response.headers = {};
        }

        // Set up CORS
        response.headers['Access-Control-Allow-Origin'] = '*';<commit_msg>Use bluebird as the global Promise implementation<commit_after>"use strict";

/*
 * RESTBase web service entry point
 *
 * Sets up a restbase instance by loading and setting up handlers and the
 * storage layer, and then dispatches requests to it.
 */

global.Promise = require('bluebird');

var rbUtil = require('./rbUtil');
var proxyHandler = require('./proxyHandler');
var Restbase = require('./restbase');
var http = require('http');
var fs = require('fs');
var RouteSwitch = require('routeswitch');

var app = {
    // The global proxy object
    proxy: null
};

function handleResponse (opts, newReq, resp, response) {
    //console.log('resp', response);
    if (response && response.status) {
        if (!response.headers) {
            response.headers = {};
        }

        // Set up CORS
        response.headers['Access-Control-Allow-Origin'] = '*';
{'fraction_non_alphanumeric': 0.14332603938730853, 'fraction_numerical': 0.0016411378555798686, 'mean_word_length': 3.2534883720930234, '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': '1720827', 'n_tokens_mistral': 517, 'n_tokens_neox': 506, 'n_words': 163}