<commit_before>var express = require('express');
var app = express();
app.use(express.bodyParser());

var messages = [
	{
		id: 1,
		text: "My awesome message 1"
	},
	{
		id: 2,
		text: "My awesome message 2"
	}
];

app.get('/messages', function(req, res) {
	console.log("Received a request to get all the messages.");
	res.json(messages);
	end();
});

app.get('/messages/:id', function(req, res) {
	var id = req.params.id;
	console.log("Received a request to get the message#"+id+".");
	res.json(messages[id-1]);
	end();
});

app.put('/messages/:id', function(req, res) {
	var id = req.params.id;
	var input = req.body;

	console.dir(input)

	console.log("Received a request to update the message#"+id);

	// In case of a modification of the id by the user...
	input.id = id;

	messages[id-1] = input;

	console.log("return:");
	console.dir(messages[id-1]);
	res.json(messages[id-1]);
	end();
});

var end = function(){
	console.log("MESSAGES:");
	console.dir(messages);
}
<commit_msg>Bug fix on the fake server (cast id in integer)<commit_after>var express = require('express');
var app = express();
app.use(express.bodyParser());

var messages = [
	{
		id: 1,
		text: "My awesome message 1"
	},
	{
		id: 2,
		text: "My awesome message 2"
	}
];

app.get('/messages', function(req, res) {
	console.log("Received a request to get all the messages.");
	res.json(messages);
	end();
});

app.get('/messages/:id', function(req, res) {
	var id = req.params.id;
	console.log("Received a request to get the message#"+id+".");
	res.json(messages[id-1]);
	end();
});

app.put('/messages/:id', function(req, res) {
	var id = req.params.id;
	var input = req.body;

	console.dir(input)

	console.log("Received a request to update the message#"+id);

	// In case of a modification of the id by the user...
	input.id = parseInt(id);

	messages[id-1] = input;

	console.log("return:");
	console.dir(messages[id-1]);
	res.json(messages[id-1]);
	end();
});

var end = function(){
	console.log("MESSAGES:");
	console.dir(messages);
}

{'fraction_non_alphanumeric': 0.19345238095238096, 'fraction_numerical': 0.007936507936507936, 'mean_word_length': 4.0425, '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': '7235972', 'n_tokens_mistral': 751, 'n_tokens_neox': 725, 'n_words': 193}