<commit_before>module.exports = function(app) {
  var posts = require("../controllers/posts")(app);

  // Get all posts
  app.get(app.custom.paths.posts.default, function(req, res) {
    posts.getAll(req, res);
  });

  // Get single post
  app.get(app.custom.paths.posts.single, function(req, res) {
    posts.getOne(req, res);
  });

  // Remove post
  app.delete(app.custom.paths.posts.remove, function(req, res) {
    posts.remove(req, res);
  });

  // Create post
  app.post(app.custom.paths.posts.new, function(req, res) {
    posts.insert(req, res);
  });

  // Update post
  app.put(app.custom.paths.posts.update, function(req, res) {
    posts.update(req, res);
  });

}<commit_msg>Refactoring posts route<commit_after>module.exports = function(app) {
  var posts = require("../controllers/posts")(app);

  app.get(app.custom.paths.posts.default,   posts.getAll)
     .get(app.custom.paths.posts.single,    posts.getById)
     .post(app.custom.paths.posts.new,      posts.insert)
     .put(app.custom.paths.posts.update,    posts.update)
     .delete(app.custom.paths.posts.remove, posts.remove);
}
{'fraction_non_alphanumeric': 0.17418772563176896, 'fraction_numerical': 0.0, 'mean_word_length': 3.315175097276265, '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': '3167389', 'n_tokens_mistral': 393, 'n_tokens_neox': 385, 'n_words': 59}