<commit_before>var express = require('express');

var itemCtrl		= require('../item/item.controller'),
	userCtrl 		= require('../user/user.controller'),
	//basicuthCtrl 	= require('../auth/basic/basic.controller'),
	authCtrl 	= require('../auth/auth.controller');
	settingCtrl 	=require('../setting/setting.controller');
	apiDoc = require('./api-doc.json');

//todo set productive routes

var router=express.Router();

router.route('/item')
	.post(authCtrl.isAuthenticated, itemCtrl.postItem)
	.get(itemCtrl.getAllItems);
router.route('/item/:objID')
	.get(itemCtrl.getItem)
	.put(authCtrl.isAuthenticated, itemCtrl.putItem)
	.delete(authCtrl.isAuthenticated, itemCtrl.deleteItem);
	
router.route('/user')
	.get(authCtrl.isAuthenticated, authCtrl.isAdmin ,userCtrl.getAllUsers);
	//.get(userCtrl.getAllUsers);
router.route('/user/:objID')
	.get(authCtrl.isAuthenticated, userCtrl.getUser)
	.put(authCtrl.isAuthenticated ,userCtrl.updateUser)
	.delete(userCtrl.deleteUser);

router.route('/login')
	.post(authCtrl.postLogin);
router.route('/signup')
	.post(authCtrl.validateSignupCode,authCtrl.postSignUp);
router.route('/reset/:token')
	.post(authCtrl.postReset);
router.route('/forgot')
	.post(authCtrl.postForgot);



router.route('/settings')
	.post(settingCtrl.postSetting)
	.get(settingCtrl.getAllSettings);
router.route('/settings/:name')
	.get(settingCtrl.getSetting)	
	.put(settingCtrl.putSetting);
router.route('/settings/:objID')
	.delete(settingCtrl.deleteSetting);


router.get('/', function(req, res){
	res.json({message: 'Welcome in Grocerybot, the datasource of your multilingual grocery applications, following the api documentation', apiDoc});
});

module.exports = router;<commit_msg>server - setting routes protected<commit_after>var express = require('express');

var itemCtrl		= require('../item/item.controller'),
	userCtrl 		= require('../user/user.controller'),
	//basicuthCtrl 	= require('../auth/basic/basic.controller'),
	authCtrl 	= require('../auth/auth.controller');
	settingCtrl 	=require('../setting/setting.controller');
	apiDoc = require('./api-doc.json');

//todo set productive routes

var router=express.Router();

router.route('/item')
	.post(authCtrl.isAuthenticated, itemCtrl.postItem)
	.get(itemCtrl.getAllItems);
router.route('/item/:objID')
	.get(itemCtrl.getItem)
	.put(authCtrl.isAuthenticated, itemCtrl.putItem)
	.delete(authCtrl.isAuthenticated, itemCtrl.deleteItem);
	
router.route('/user')
	.get(authCtrl.isAuthenticated, authCtrl.isAdmin ,userCtrl.getAllUsers);
	//.get(userCtrl.getAllUsers);
router.route('/user/:objID')
	.get(authCtrl.isAuthenticated, userCtrl.getUser)
	.put(authCtrl.isAuthenticated ,userCtrl.updateUser)
	.delete(userCtrl.deleteUser);

router.route('/login')
	.post(authCtrl.postLogin);
router.route('/signup')
	.post(authCtrl.validateSignupCode,authCtrl.postSignUp);
router.route('/reset/:token')
	.post(authCtrl.postReset);
router.route('/forgot')
	.post(authCtrl.postForgot);



router.route('/settings')
	.post(authCtrl.isAuthenticated, authCtrl.isAdmin, settingCtrl.postSetting)
	.get(authCtrl.isAuthenticated, authCtrl.isAdmin,settingCtrl.getAllSettings);
router.route('/settings/:name')
	.get(authCtrl.isAuthenticated, authCtrl.isAdmin, settingCtrl.getSetting)	
	.put(authCtrl.isAuthenticated, authCtrl.isAdmin, settingCtrl.putSetting);
router.route('/settings/:objID')
	.delete(authCtrl.isAuthenticated, authCtrl.isAdmin,settingCtrl.deleteSetting);


router.get('/', function(req, res){
	res.json({message: 'Welcome in Grocerybot, the datasource of your multilingual grocery applications, following the api documentation', apiDoc});
});

module.exports = router;
{'fraction_non_alphanumeric': 0.1673076923076923, 'fraction_numerical': 0.0, 'mean_word_length': 6.0562015503875966, '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': '1274695', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1205, 'n_words': 170}