<commit_before>var express = require('express');
var router = express.Router();

var User = require('../models/user');

module.exports = function(app, mountPoint) {
  router.get('/', function(req, res) {
    User.find(function(err, data) {
      if (err) throw err;
      res.json(data);
    });
  });

  router.post('/', function(req, res) {
    User.create(req.body, function(err, data) {
      if (err) throw err;
      res.json(data);
    });
  });

  router.put('/', function(req, res) {
    User.update({_id: req.body._id}, req.body, function(err, data) {
      if (err) throw err;
      res.json(data);
      console.log(req.body);
    });
  });
<commit_msg>Add search for a user to later modify a profile<commit_after>var express = require('express');
var router = express.Router();

var User = require('../models/user');

module.exports = function(app, mountPoint) {
  router.get('/', function(req, res) {
    User.find(function(err, data) {
      if (err) throw err;
      res.json(data);
    });
  });

  router.get('/:id', function(req, res) {
    User.findOne({_id: req.body._id}, function(err, data) {
      if (err) throw err;
      res.json(data);
    });
  });

  router.post('/', function(req, res) {
    User.create(req.body, function(err, data) {
      if (err) throw err;
      res.json(data);
    });
  });

  router.put('/', function(req, res) {
    User.update({_id: req.body._id}, req.body, function(err, data) {
      if (err) throw err;
      res.json(data);
      console.log(req.body);
    });
  });

{'fraction_non_alphanumeric': 0.1962066710268149, 'fraction_numerical': 0.0, 'mean_word_length': 2.853904282115869, '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': '4844145', 'n_tokens_mistral': 531, 'n_tokens_neox': 525, 'n_words': 115}