<commit_before>/* 
 server.js
 mongodb-rest
 
 Created by <NAME> on 2010-10-03.
 Copyright (c) 2010 <NAME>.
 This file is part of mongodb-rest.
 */

var fs = require("fs"),
        sys = require("sys"),
        express = require('express');

var config = {"db": {
        'port': 27017,
        'host': "localhost"
    },
    "accessControl": {
        "allowOrigin": "*",
        "allowMethods": "GET,POST,PUT,DELETE,HEAD,OPTIONS"
    },
    'server': {
        'port': 3000,
        'address': "0.0.0.0"
    },
    'flavor': "regular",
    'debug': true
};

var app = module.exports.app = express();

try {
    config = JSON.parse(fs.readFileSync(process.cwd() + "/config.json"));
} catch (e) {
    // ignore
}

module.exports.config = config;

app.configure(function() {
    app.use(express.bodyParser());
    app.use(express.static(process.cwd() + '/public'));
    app.use(express.logger());

    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');

    if (config.accessControl) {
        var accesscontrol = require('./lib/accesscontrol');
        app.use(accesscontrol.handle);
    }
});

require('./lib/main');
require('./lib/command');
require('./lib/rest');
require('./lib/snomed');

if (!process.argv[2] || !process.argv[2].indexOf("expresso")) {
    app.listen(config.server.port, config.server.address);
}<commit_msg>Tuning other express warnings<commit_after>/* 
 server.js
 mongodb-rest
 
 Created by <NAME> on 2010-10-03.
 Copyright (c) 2010 <NAME>.
 This file is part of mongodb-rest.
 */

var fs = require("fs"),
        sys = require("sys"),
        express = require('express');

var config = {"db": {
        'port': 27017,
        'host': "localhost"
    },
    "accessControl": {
        "allowOrigin": "*",
        "allowMethods": "GET,POST,PUT,DELETE,HEAD,OPTIONS"
    },
    'server': {
        'port': 3000,
        'address': "0.0.0.0"
    },
    'flavor': "regular",
    'debug': true
};

var app = module.exports.app = express();

try {
    config = JSON.parse(fs.readFileSync(process.cwd() + "/config.json"));
} catch (e) {
    // ignore
}

module.exports.config = config;

app.configure(function() {
    app.use(express.json());
    app.use(express.urlencoded());
    app.use(express.static(process.cwd() + '/public'));
    app.use(express.logger());

    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');

    if (config.accessControl) {
        var accesscontrol = require('./lib/accesscontrol');
        app.use(accesscontrol.handle);
    }
});

require('./lib/main');
require('./lib/command');
require('./lib/rest');
require('./lib/snomed');

if (!process.argv[2] || !process.argv[2].indexOf("expresso")) {
    app.listen(config.server.port, config.server.address);
}
{'fraction_non_alphanumeric': 0.20450417726116962, 'fraction_numerical': 0.01961496549219034, 'mean_word_length': 2.92867332382311, 'pattern_counts': {'":': 8, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4567708', 'n_tokens_mistral': 955, 'n_tokens_neox': 905, 'n_words': 172}