<commit_before>// sets up server requirements
var express = require('express'),
  bodyParser = require('body-parser'),
  mongoose = require('mongoose');

//require database
var db = require('./DB/db.js');

//creates server
var app = express();

//creates default port
var port = process.env.PORT || 4444;

//middleware
app.use(express.static(__dirname + '/app/'));
app.use(bodyParser.json());

// %%%%%%%%%%%This Should Fix our CORS%%%%%%%%%%%%%%%%%%%%
app.use(function(req, res, next){
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Headers', 'X-Requested-With');
    next();
});
// %%%%%%%%%%%%%^^^^^^^^^^^^^^^%%%%%%%%%%%%%%%%%%%%%%%%%%%

//mongoose connection
mongoose.connect('mongodb://IndigoZone:<EMAIL>.<EMAIL>:19481/heroku_vj69wpp5'); 

//connects app and port
app.listen(port);

//handles register
app.post('/api/register', function(req,res){
  db.create({
    username: req.body.username,
    password: <PASSWORD>
  }, function(err, user){
    res.send(user);
  });

});

//handles login
app.post('/api/login', function(req,res){
  db.findOne({username:req.body.username}, function(err, user){
    if (err){
      res.send(err);
    } else if(user){
      if(req.body.password === user.password){
        res.send('success');
      }
    } else {
      res.send('failure');
    }<commit_msg>Updating Database for Andy's Deploy<commit_after>// sets up server requirements
var express = require('express'),
  bodyParser = require('body-parser'),
  mongoose = require('mongoose');

//require database
var db = require('./DB/db.js');

//creates server
var app = express();

//creates default port
var port = process.env.PORT || 4444;

//middleware
app.use(express.static(__dirname + '/app/'));
app.use(bodyParser.json());

// %%%%%%%%%%%This Should Fix our CORS%%%%%%%%%%%%%%%%%%%%
app.use(function(req, res, next){
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Headers', 'X-Requested-With');
    next();
});
// %%%%%%%%%%%%%^^^^^^^^^^^^^^^%%%%%%%%%%%%%%%%%%%%%%%%%%%

//mongoose connection
mongoose.connect('mongodb://indigozone:<EMAIL>:15962/heroku_v75xg8cs'); 

//connects app and port
app.listen(port);

//handles register
app.post('/api/register', function(req,res){
  db.create({
    username: req.body.username,
    password: <PASSWORD>
  }, function(err, user){
    res.send(user);
  });

});

//handles login
app.post('/api/login', function(req,res){
  db.findOne({username:req.body.username}, function(err, user){
    if (err){
      res.send(err);
    } else if(user){
      if(req.body.password === user.password){
        res.send('success');
      }
    } else {
      res.send('failure');
    }
{'fraction_non_alphanumeric': 0.24074074074074073, 'fraction_numerical': 0.008888888888888889, 'mean_word_length': 3.9833948339483394, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2293003', 'n_tokens_mistral': 898, 'n_tokens_neox': 879, 'n_words': 168}