<commit_before>"use strict";

var express = require('express')
  , UserCtrl = require('../../controller/user')
  , PostCtrl = require('../../controller/post')
  ;

var post = express();

post.use('/posts', UserCtrl.requireUser);

/**
 * @api {get} /posts/:pid Get individual post
 * @apiName GetPost
 * @apiGroup Post
 *
 * @apiParam {ObjectId} :pid Post's unique ID.
 *
 * @apiUse SuccessCode
 * @apiUse Post
 *
 * @apiUse PostNotFound
 *
 */
post.get('/posts/:pid', UserCtrl.permitStudentOrAdmin, PostCtrl.loadPost, PostCtrl.getPost);

post.post('/posts',  UserCtrl.permitStudent, PostCtrl.loadPost, PostCtrl.addPost);

/**
 * @apiIgnore deprecated
 * @api {get} /posts/:pid/comments Request comments on the post
 * @apiName GetCommentsOnPost
 * @apiGroup Post
 *
 */
// post.get('/posts/:pid/comments', UserCtrl.permitStudentOrAdmin, PostCtrl.loadPost, PostCtrl.getCommentsOnPost);
<commit_msg>route/post<commit_after>"use strict";

var express = require('express')
  , UserCtrl = require('../../controller/user')
  , PostCtrl = require('../../controller/post')
  ;

var post = express();

post.use('/posts', UserCtrl.requireUser);

/**
 * @api {get} /posts/:pid Get individual post
 * @apiName GetPost
 * @apiGroup Post
 *
 * @apiParam {ObjectId} :pid Post's unique ID.
 *
 * @apiUse SuccessCode
 * @apiUse Post
 *
 * @apiUse PostNotFound
 *
 */
post.get('/posts/:pid', UserCtrl.permitStudentOrAdmin, PostCtrl.loadPost, PostCtrl.getPost);

/**
 * @api {post} /posts add post
 * @apiName AddPost
 * @apiGroup Post
 *
 * @apiUse SuccessCode
 *
 * @apiUse PostAddedFailed
 * @apiUse TitleOfPostIsInvalid
 * @apiUse TextOfPostIsInvalid
 * 
 */
post.post('/posts',  UserCtrl.permitStudent, PostCtrl.loadPost, PostCtrl.addPost);

/**
 * @apiIgnore deprecated
 * @api {get} /posts/:pid/comments Request comments on the post
 * @apiName GetCommentsOnPost
 * @apiGroup Post
 *
 */
// post.get('/posts/:pid/comments', UserCtrl.permitStudentOrAdmin, PostCtrl.loadPost, PostCtrl.getCommentsOnPost);

{'fraction_non_alphanumeric': 0.16373681567051732, 'fraction_numerical': 0.0, 'mean_word_length': 4.214659685863874, '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': '3701303', 'n_tokens_mistral': 653, 'n_tokens_neox': 651, 'n_words': 141}