<commit_before>//modules and configs
//===============================================
var express  = require('express'),
    router   = express.Router(),
    app      = express(),
    bodyParser = require('body-parser')
    mongoose = require('mongoose');

var port = process.env.port || 3000; //port set to 3000

// mongodb uri
var uristring = process.env.MONGODB_URI;

mongoose.connect(uristring, function (err, res) {
  if (err) {
    console.log('Error connecting to db');
  } else {
    console.log('Succeeded in connecting to db');
  }
})

var reqSchema = new mongoose.Schema({
  name: { type: String },
  email: { type: String },
  phone: { type: String },
  address: { type: String },
  reqBloodType: { type: String },
  quantity: { type: Number },
  reqOn: { type: String }
});

var BloodReq = mongoose.model('bloodreqs', reqSchema);

//app specific configurations
//==================================================

app.use('/', express.static(__dirname + '/app/'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

//router configurations
//============================================

router.get('/', function (req, res) {
	res.render('/index.html');
});

router.post('/submit', function (req, res) {
  var data = req.body.data;
  var aReq = new BloodReq({
    name: data.name || '',
    email: data.email || '',
    phone: data.phone || '',
    address: data.address || '',
    group: data.group || '',
    quantity: data.quantity || '',
    date: data.date || ''
  });
  aReq.save(function (err, obj) {
    if (err) {
      console.log('Error on save!')
    } else {
      console.log('Saving', obj);
      res.json(obj);
    }
  });
});


app.use('/', router);

//run the server========================
var server = app.listen(port, function(){
	console.log('server has started running at localhost:' + port);
});<commit_msg>corrected db schema field name.<commit_after>//modules and configs
//===============================================
var express  = require('express'),
    router   = express.Router(),
    app      = express(),
    bodyParser = require('body-parser')
    mongoose = require('mongoose');

var port = process.env.port || 3000; //port set to 3000

// mongodb uri
var uristring = process.env.MONGODB_URI;

mongoose.connect(uristring, function (err, res) {
  if (err) {
    console.log('Error connecting to db');
  } else {
    console.log('Succeeded in connecting to db');
  }
})

var reqSchema = new mongoose.Schema({
  name: { type: String },
  email: { type: String },
  phone: { type: String },
  address: { type: String },
  group: { type: String },
  quantity: { type: Number },
  reqOn: { type: String }
});

var BloodReq = mongoose.model('bloodreqs', reqSchema);

//app specific configurations
//==================================================

app.use('/', express.static(__dirname + '/app/'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

//router configurations
//============================================

router.get('/', function (req, res) {
	res.render('/index.html');
});

router.post('/submit', function (req, res) {
  var data = req.body.data;
  var aReq = new BloodReq({
    name: data.name || '',
    email: data.email || '',
    phone: data.phone || '',
    address: data.address || '',
    group: data.group || '',
    quantity: data.quantity || '',
    date: data.date || ''
  });
  aReq.save(function (err, obj) {
    if (err) {
      console.log('Error on save!');
    } else {
      console.log('Saving', obj);
      res.json(obj);
    }
  });
});


app.use('/', router);

//run the server========================
var server = app.listen(port, function(){
	console.log('server has started running at localhost:' + port);
});
{'fraction_non_alphanumeric': 0.25664187035069075, 'fraction_numerical': 0.004250797024442083, 'mean_word_length': 3.613970588235294, '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': '3970699', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1136, 'n_words': 288}