<commit_before>var express = require('express')
var app = express()

var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/academydb');


var bodyParser = require('body-parser');
var paragraph = require('./model/paragraph.model');

app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.raw());
app.use(bodyParser.json());
app.use(function(req, res, next) {
	res.setHeader('Access-Control-Allow-Origin', '*');
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST');
    res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type, Authorization');
    res.setHeader('Content-Type', 'application/json');
    next();
});

app.set('json spaces', 2);

app.post('/api/paragraph/create', function(req, res) {

	var newParagraph = paragraph(req.body);

	if (!req.body){ 

	 	return res.sendStatus(400);
	
	}else{

	 	newParagraph.save(function(err) {
	 	  if (err){ res.send(err); };
	 	  res.send('Paragraph created!');
	 	});

	}

});

app.get('/api/paragraph/:id', function(req, res) {

	paragraph.findById(req.params.id, function(err,paragraph){

		res.send(paragraph);

	});

});

app.get('/api/paragraph', function(req, res) {
	paragraph.find(function(err,paragraph){
	console.log('p',paragraph);
		res.send(paragraph);

	});

});

app.listen(82);
console.log("App listening on port 82");
<commit_msg>changing service and add paragraph service<commit_after>var express = require('express')
var app = express()

var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/academydb');


var bodyParser = require('body-parser');
var paragraph = require('./model/paragraph.model');

app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.raw());
app.use(bodyParser.json());
app.use(function(req, res, next) {
	res.setHeader('Access-Control-Allow-Origin', '*');
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST');
    res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type, Authorization');
    res.setHeader('Content-Type', 'application/json');
    next();
});

app.set('json spaces', 2);

app.post('/api/paragraph/create', function(req, res) {

	var newParagraph = paragraph(req.body);

	if (!req.body){ 

	 	return res.sendStatus(400);
	
	}else{

	 	newParagraph.save(function(err) {
	 	  if (err){ res.send(err); };
	 	  res.send('Paragraph created!');
	 	});

	}

});

app.get('/api/paragraph/:id', function(req, res) {

	paragraph.findById(req.params.id, function(err,paragraph){

		res.send(paragraph);

	});

});

app.get('/api/paragraph', function(req, res) {
	paragraph.find({},function(err,paragraph){
	console.log('p',paragraph);
		res.send(paragraph);

	});

});

app.listen(82);
console.log("App listening on port 82");

{'fraction_non_alphanumeric': 0.2000726216412491, 'fraction_numerical': 0.005809731299927378, 'mean_word_length': 4.963203463203463, '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': '3249951', 'n_tokens_mistral': 975, 'n_tokens_neox': 922, 'n_words': 149}