<commit_before>//Basic Event class
function Event(id, name, time, place){
	this.id = id;
	this.name = name;
	this.time = time;
	this.place = place;
	this.toJSON = function(){
		return {id: this.id, name: this.name, time: this.time, place: this.place};
	};
};


//Array of events
var events=[new Event(0, 'Fire', '12:04PM', 'Building'),
            new Event(1, 'Bomb', '12:05PM', 'Field'),
            new Event(2, 'Flood', '3:00PM', 'Everywhere')];


// This uses bogart. To install, run npm install bogart
// https://github.com/nrstott/bogart
var bogart = require('bogart');

var router = bogart.router();

router.get('/', function(req){
	console.log('Request for /');
	return bogart.json({modules: mods});
});


//Send the number of events
router.get('/events/?', function(req){
	console.log('Request for list of events');
	return bogart.json({count: events.length});
});

//And set up to return the JSON for each one
router.get('/events/:id', function(req){
	console.log('Request for event # '+req.params.id);
	if(req.params.id < events.length){
		return bogart.json(events[req.params.id].toJSON());
	} else {
		return bogart.error();
	}
});



//Set it up to run
var app = bogart.app();
app.use(bogart.batteries);
app.use(router);

//Start it
app.start(8080, '127.0.0.1');<commit_msg>Dont need the toJson function<commit_after>//Basic Event class
function Event(id, name, time, place){
	this.id = id;
	this.name = name;
	this.time = time;
	this.place = place;
};


//Array of events
var events=[new Event(0, 'Fire', '12:04PM', 'Building'),
            new Event(1, 'Bomb', '12:05PM', 'Field'),
            new Event(2, 'Flood', '3:00PM', 'Everywhere')];


// This uses bogart. To install, run npm install bogart
// https://github.com/nrstott/bogart
var bogart = require('bogart');

var router = bogart.router();

router.get('/', function(req){
	console.log('Request for /');
	return bogart.json({events: "events"});
});


//Send the number of events
router.get('/events/?', function(req){
	console.log('Request for list of events');
	return bogart.json({count: events.length});
});

//And set up to return the JSON for each one
router.get('/events/:id', function(req){
	console.log('Request for event # '+req.params.id);
	if(req.params.id < events.length){
		return bogart.json(events[req.params.id]);
	} else {
		return bogart.error();
	}
});



//Set it up to run
var app = bogart.app();
app.use(bogart.batteries);
app.use(router);

//Start it
app.start(8080, '127.0.0.1');
{'fraction_non_alphanumeric': 0.19112903225806452, 'fraction_numerical': 0.01935483870967742, 'mean_word_length': 3.8838582677165356, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3531609', 'n_tokens_mistral': 920, 'n_tokens_neox': 875, 'n_words': 234}