<commit_before>var express = require('express'),
    stylus = require('stylus'),
    logger = require('morgan'),
    bodyParser = require('body-parser'),
    mongoose = require('mongoose');


var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development';

var app = express();

function compile(str, path) {
  return stylus(str).set('filename', path);
};

app.set('views', __dirname + '/server/views');
app.set('view engine', 'jade');
app.use(logger('dev'));
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(stylus.middleware(
{
  src: __dirname + '/public',
  compile: compile
}
));

app.use(express.static(__dirname+ '/public'));

//setup for db

mongoose.connect('mongodb://localhost:27017/gaming-boardz');
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error...'));
db.once('open', function callback() {
  console.log('gaming-boardz db opened');
});<commit_msg>add mongoLabs. config server.js to differ prod or dev. pushing to heroku next commit.<commit_after>var express = require('express'),
    stylus = require('stylus'),
    logger = require('morgan'),
    bodyParser = require('body-parser'),
    mongoose = require('mongoose');


var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development';

var app = express();

function compile(str, path) {
  return stylus(str).set('filename', path);
};

app.set('views', __dirname + '/server/views');
app.set('view engine', 'jade');
app.use(logger('dev'));
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(stylus.middleware(
{
  src: __dirname + '/public',
  compile: compile
}
));

app.use(express.static(__dirname+ '/public'));

//setup for db
if(env === 'development') {
  mongoose.connect('mongodb://localhost/gaming-boardz');
} else {
  mongoose.connect('mongodb://bgarza:<EMAIL>:41613/gaming-boardz');
}//this is for moving between prod and dev when deployed to heroku
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error...'));
db.once('open', function callback() {
  console.log('gaming-boardz db opened');
});
{'fraction_non_alphanumeric': 0.19103222793087343, 'fraction_numerical': 0.004670714619336758, 'mean_word_length': 5.155172413793103, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5639740', 'n_tokens_mistral': 705, 'n_tokens_neox': 699, 'n_words': 151}