<commit_before>'use strict';

var restify = require('restify');

var server = restify.createServer();

var applications = require('./../controllers/static/applications');
var leaderboard = require('./../controllers/static/leaderboard');
var users = require('./../controllers/static/users');

//var hdl = require('./default_handler'); // default handler


server.listen(8080, function () {
  console.log('%s listening at %s', server.name, server.url);
});


// TODO this is needed for your tests to pass.....
exports.awesome = function () {
	return 'awesome';
};



////////////////////////////////////////////////////////////////////////////////////
// Applications
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications', applications.findAll);
server.get('/applications/:appid', applications.findById);

// post
server.post('/applications', applications.create);


////////////////////////////////////////////////////////////////////////////////////
// Leaderboard
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/leaderboard', leaderboard.findAll);


////////////////////////////////////////////////////////////////////////////////////
// Users
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/users', users.findAll);
server.get('/applications/:appid/users/:userid', users.findById);
server.get('/applications/:appid/users/:userid/badges', users.findBadgesById);

// post
server.post('/applications/:appid/users', users.create);

// put
// server.put('/applications/:appid/users/:userid', putMessage);

// delete
// server.delete('/applications/:appid/users/:userid', deleteMessage);



////////////////////////////////////////////////////////////////////////////////////
// Events
////////////////////////////////////////////////////////////////////////////////////

// get
// server.get('/applications/:appid/events', hdl.getMessages);
// server.get('/applications/:appid/events/:eventid', hdl.getMessages);

// post
// server.post('/applications/:appid/events', hdl.postMessage);


////////////////////////////////////////////////////////////////////////////////////
// Event Types
////////////////////////////////////////////////////////////////////////////////////

// get
// server.get('/applications/:appid/events/types', hdl.getMessages);
// server.get('/applications/:appid/events/types/:typeid', hdl.getMessages);

// post
// server.post('/applications/:appid/events/types', hdl.postMessage);


////////////////////////////////////////////////////////////////////////////////////
// Rules
////////////////////////////////////////////////////////////////////////////////////

// get
// server.get('/applications/:appid/rules', hdl.getMessages);
// server.get('/applications/:appid/rules/:ruleid', hdl.getMessages);

// post
// server.post('/applications/:appid/rules', hdl.postMessage);

// put
// server.put('/applications/:appid/rules/:ruleid', putMessage);

// delete
// server.delete('/applications/:appid/rules/:ruleid', deleteMessage);

////////////////////////////////////////////////////////////////////////////////////
// Badges
////////////////////////////////////////////////////////////////////////////////////

// get
// server.get('/applications/:appid/badges', hdl.getMessages);
// server.get('/applications/:appid/badges/:badgeid', hdl.getMessages);

// post
// server.post('/applications/:appid/badges', hdl.postMessage);

// put
// server.put('/applications/:appid/badges/:badgeid', putMessage);


////////////////////////////////////////////////////////////////////////////////////
// Badge Categories
////////////////////////////////////////////////////////////////////////////////////

// get
// server.get('/applications/:appid/badges/categories', hdl.getMessages);
// TODO duplicate query in apiaryio server.get('/applications/:appid/badges', hdl.getMessages);

// post
// server.post('/applications/:appid/badges/categories/', hdl.postMessage);

// put
// server.put('/applications/:appid/badges/categories/:categoryid', putMessage);
<commit_msg>added routes to last static handlers<commit_after>'use strict';

var restify = require('restify');

var server = restify.createServer();

// set static controllers for now...
var controller_path = './../controllers/static/';

// load controllers
var applications	= require(controller_path + 'applications');
var leaderboard	= require(controller_path + 'leaderboard');
var users			= require(controller_path + 'users');
var events		= require(controller_path + 'events');
var event_types	= require(controller_path + 'event_types');
var rules			= require(controller_path + 'rules');
var badges		= require(controller_path + 'badges');
var badge_cats		= require(controller_path + 'badge_categories');


//var hdl = require('./default_handler'); // default handler


server.listen(8080, function () {
	console.log('%s listening at %s', server.name, server.url);
});


// TODO this is needed for your tests to pass.....
exports.awesome = function () {
	return 'awesome';
};



////////////////////////////////////////////////////////////////////////////////////
// Applications
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications', applications.findAll);
server.get('/applications/:appid', applications.findById);

// post
server.post('/applications', applications.create);


////////////////////////////////////////////////////////////////////////////////////
// Leaderboard
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/leaderboard', leaderboard.findAll);


////////////////////////////////////////////////////////////////////////////////////
// Users
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/users', users.findAll);
server.get('/applications/:appid/users/:userid', users.findById);
server.get('/applications/:appid/users/:userid/badges', users.findBadgesById);

// post
server.post('/applications/:appid/users', users.create);

// put
server.put('/applications/:appid/users/:userid', users.update);

// delete
server.del('/applications/:appid/users/:userid', users.remove);



////////////////////////////////////////////////////////////////////////////////////
// Events
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/events', events.findAll);
server.get('/applications/:appid/events/:eventid', events.findById);

// post
server.post('/applications/:appid/events', events.create);


////////////////////////////////////////////////////////////////////////////////////
// Event Types
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/events/types', event_types.findAll);
server.get('/applications/:appid/events/types/:typeid', event_types.findById);

// post
server.post('/applications/:appid/events/types', event_types.create);


////////////////////////////////////////////////////////////////////////////////////
// Rules
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/rules', rules.findAll);
server.get('/applications/:appid/rules/:ruleid', rules.findById);

// post
server.post('/applications/:appid/rules', rules.create);

// put
server.put('/applications/:appid/rules/:ruleid', rules.update);

// delete
server.del('/applications/:appid/rules/:ruleid', rules.remove);

////////////////////////////////////////////////////////////////////////////////////
// Badges
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/badges', badges.findAll);
server.get('/applications/:appid/badges/:badgeid', badges.findById);

// post
server.post('/applications/:appid/badges', badges.create);

// put
server.put('/applications/:appid/badges/:badgeid', badges.update);


////////////////////////////////////////////////////////////////////////////////////
// Badge Categories
////////////////////////////////////////////////////////////////////////////////////

// get
server.get('/applications/:appid/badges/categories', badge_cats.findAll);
server.get('/applications/:appid/badges/categories', badge_cats.findById);

// post
server.post('/applications/:appid/badges/categories/', badge_cats.create);

// put
server.put('/applications/:appid/badges/categories/:categoryid', badge_cats.update);

{'fraction_non_alphanumeric': 0.43957807842238017, 'fraction_numerical': 0.0009172208209126347, 'mean_word_length': 1.292509855453351, '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': '6231379', 'n_tokens_mistral': 1987, 'n_tokens_neox': 2014, 'n_words': 307}