<commit_before>const fs = require('fs');
const express = require('express');
const jsonParser = require('body-parser').json();
const handleDBError = require(__dirname + '/../lib/handleDBError');
const basicHTTP = require(__dirname + '/../lib/basic_http');
const User = require(__dirname + '/../models/user');
const CPmodel = require(__dirname + '/../models/CPmodel');
const jwtAuth = require(__dirname + '/../lib/jwt_auth');

var soloRouter = module.exports = exports = express.Router();

//route zero
soloRouter.get('/', (req, res) => {
  fs.readStream('index.html').pipe(res);
});

//route 3
soloRouter.post('/newCP', jwtAuth, (req, res) => {
  CPmodel.save(err, stuff)//this needs work
});

//route 4
soloRouter.get('/profile', jwtAuth, (req, res) => {
  CPmodel.find({user: req.user.id}, (err, userCP) => {<commit_msg>change the CPmodel.js to cp.js<commit_after>const fs = require('fs');
const express = require('express');
const jsonParser = require('body-parser').json();
const handleDBError = require(__dirname + '/../lib/handleDBError');
const basicHTTP = require(__dirname + '/../lib/basic_http');
const User = require(__dirname + '/../models/user');
const CPmodel = require(__dirname + '/../models/cp');
const jwtAuth = require(__dirname + '/../lib/jwt_auth');

var soloRouter = module.exports = exports = express.Router();

//route zero
soloRouter.get('/', (req, res) => {
  fs.readStream('index.html').pipe(res);
});

//route 3
soloRouter.post('/newCP', jwtAuth, (req, res) => {
  CPmodel.save(err, stuff)//this needs work
});

//route 4
soloRouter.get('/profile', jwtAuth, (req, res) => {
  CPmodel.find({user: req.user.id}, (err, userCP) => {
{'fraction_non_alphanumeric': 0.21014492753623187, 'fraction_numerical': 0.0024154589371980675, 'mean_word_length': 4.579124579124579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6369847', 'n_tokens_mistral': 541, 'n_tokens_neox': 536, 'n_words': 124}