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

var bookStore = new BookStore();
bookStore.add('Pride And Prejudice', function(err, result) {
	console.log('Book Added');
});

router.route('/books')
	.get(function(req, res) {
		bookStore.list(function(err, data) {
			res.json(data);
		});
	})
	.post(function(req, res) {

	});

module.exports = router;<commit_msg>Added PUT example<commit_after>var express = require('express');
var BookStore = require('./BookStore');
var router = express.Router();

var bookStore = new BookStore();
bookStore.add('Pride And Prejudice', function(err, result) {
	console.log('Book Added');
});

router.route('/books')
	.get(function(req, res) {
		bookStore.list(function(err, data) {
			res.json(data);
		});
	})
	.post(function(req, res) {
		// TO DO
	});

router.route('/books/:id')
	.get(function(req, res) {
		// TO DO
	})
	.put(function(req, res) {
		var bookId = req.params.id;
		var bookTitle = req.body.title;

		bookStore.update(bookId, bookTitle, function(err) {
			res.json({status: 'OK'});
		});
	});

module.exports = router;
{'fraction_non_alphanumeric': 0.19405594405594406, 'fraction_numerical': 0.0, 'mean_word_length': 4.5048076923076925, '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': '4160846', 'n_tokens_mistral': 421, 'n_tokens_neox': 400, 'n_words': 81}