<commit_before>var moment = require('moment');
var mongoose = require('mongoose')
// mongoose.connect('mongodb://heroku:<EMAIL>:10006/app29698871')
mongoose.connect('mongodb://law:'+process.env.MONGO_PASS+'@<EMAIL>:27017/weQaxo3t')

var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function callback () {
  console.log('Connected to db');
});

var lawSchema = mongoose.Schema({
  section: String,
  title:   String,
  state:   String,
  law:     String
}, { versionKey: false });

var Law = mongoose.model('Law', lawSchema);
var laws = Law.findOne();
console.log(laws);

module.exports = {
  laws: function(req, res, next) {
    Law.find({}).exec(function(err, results){
      if (!err) {
        res.send(results);
      } else {
        res.send(err);
      }
    });
  },
  lawsByState: function(req, res, next) {
    Law.find({'state': req.params.state.toUpperCase()}).exec(function(err, results){
      if(!err) {
        res.send(results);
      } else {
        res.send(err);
      }
    });
  },
  uhoh: function(req, res, next) {
    res.send({'404':'content not found'})
  }
}<commit_msg>remove unused code<commit_after>var moment = require('moment');
var mongoose = require('mongoose')
// mongoose.connect('mongodb://heroku:6mOFBgo8Z5CAjZitQeDBmIZjaWbvtAdpKgUt-tZXgyzM5tAhxHvoz1r4jJF-iIEPPS_CKY<EMAIL>:10006/app29698871')
mongoose.connect('mongodb://law:'+process.env.MONGO_PASS+'@<EMAIL>:27017/weQaxo3t')

var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function callback () {
  console.log('Connected to db');
});

var lawSchema = mongoose.Schema({
  section: String,
  title:   String,
  state:   String,
  law:     String
}, { versionKey: false });

var Law = mongoose.model('Law', lawSchema);

module.exports = {
  laws: function(req, res, next) {
    Law.find({}).exec(function(err, results){
      if (!err) {
        res.send(results);
      } else {
        res.send(err);
      }
    });
  },
  lawsByState: function(req, res, next) {
    Law.find({'state': req.params.state.toUpperCase()}).exec(function(err, results){
      if(!err) {
        res.send(results);
      } else {
        res.send(err);
      }
    });
  },
  root: function(req, res, next) {
    res.send('hello world');
    next();
  },
  uhoh: function(req, res, next) {
    res.send({'404':'content not found'})
  }
}
{'fraction_non_alphanumeric': 0.1864476386036961, 'fraction_numerical': 0.02053388090349076, 'mean_word_length': 3.511111111111111, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1241562', 'n_tokens_mistral': 911, 'n_tokens_neox': 887, 'n_words': 149}