const express      = require('express'),
  router           = express.Router(),
  mainController   = require('./controllers/main.controller'),

   userController = require('./controllers/user.controller'),

  categoryController = require('./controllers/category.controller'),

  // itemsController = require('./controllers/item.controller'),
  // categoriesController = require('./controllers/category.controller');

  itemsController = require('./controllers/item.controller'),
  paymentController = require('./controllers/payment.controller');

 
  
var path = require('path');
router.use(express.static(path.join(__dirname , '../public/view/client')));
router.use(express.static(path.join(__dirname , '../public/view/admin')));


router.get('/admin/showAllItems', itemsController.showAllItems);
router.get('/admin', function(req,res){
    res.sendFile(path.join(__dirname , '../public/view/admin/index.html'));
});
router.post('/admin/addItem', itemsController.addItem);
router.post('/admin/deleteItem', itemsController.deleteItem);
router.post('/admin/countItem', itemsController.countItem);
router.post('/admin/changeItem', itemsController.changeItem);

router.post('/admin/signIn',userController.signIn);
router.post('/admin/signOut',userController.signOut);
router.post('/admin/getSessionInfo',userController.getSessionInfo);
// router.post('/signIn',userController.signIn);
// router.post('/signOut',userController.signOut);
// router.post('/getSessionInfo',userController.getSessionInfo);


router.get('/showAllCategories', categoryController.showAllCategories);
router.post('/showAllSubCategory', categoryController.showAllSubCategories);
router.post('/processPayment', paymentController.processPayment);
router.post('/getProductDetails', itemsController.getProductDetails);
// export router
module.exports = router;

// main routes
/*
router.get('/client', mainController.showHome);
router.get('/admin', itemsController.showAllItems);
router.get('/checkQuantity', itemsController.checkQuantity);
router.get('/deleteItem', itemsController.deleteItem);
router.get('/deleteAllItems', itemsController.deleteAllItems);
router.get('/addItem', itemsController.addItem);
router.get('/a', itemsController.a);

*/
 /* // main routes
router.get('/client', mainController.showHome);
router.get('/admin', itemsController.showAllItems);
router.get('/addItem', itemsController.addItem);
router.get('/checkQuantity', itemsController.checkQuantity);
router.get('/deleteItem', itemsController.deleteItem);
router.get('/deleteAllItem', itemsController.deleteAllItem);

router.use('/userManage',require('./Controllers/userServerController'));----------



/*router.get('*', function(req,res){
    res.sendFile(path.join(__dirname , '../public','view/admin/index.html'));
});*/

//router.get('/createItem',itemsController.createItem);
//router.get('/getAllItems',itemsController.getAllItems);

@@ -34,18 +34,17 @@
 ress'),%0A
-  
+%09
 router  
@@ -72,18 +72,17 @@
 uter(),%0A
-  
+%09
 mainCont
@@ -135,19 +135,17 @@
 ler'),%0A%0A
-   
+%09
 userCont
@@ -196,18 +196,17 @@
 ler'),%0A%0A
-  
+%09
 category
@@ -265,21 +265,17 @@
 ler'),%0A%0A
-  // 
+%09
 itemsCon
@@ -330,147 +330,9 @@
 '),%0A
-  // categoriesController = require('./controllers/category.controller');%0A%0A  itemsController = require('./controllers/item.controller'),%0A  
+%09
 paym
@@ -1183,174 +1183,8 @@
 o);%0A
-// router.post('/signIn',userController.signIn);%0A// router.post('/signOut',userController.signOut);%0A// router.post('/getSessionInfo',userController.getSessionInfo);%0A%0A
 %0Arou
@@ -1469,315 +1469,48 @@
 s);%0A
-// export router%0Amodule.exports = router;%0A%0A// main routes%0A/*%0Arouter.get('/client', mainController.showHome);%0Arouter.get('/admin', itemsController.showAllItems);%0Arouter.get('/checkQuantity', itemsController.checkQuantity);%0Arouter.get('/deleteItem', itemsController.deleteItem);%0Arouter.get('/deleteAllItems
+router.post('/getProductsOfSubCategory
 ',
- 
 item
@@ -1525,779 +1525,74 @@
 ler.
-deleteAllItems);%0Arouter.get('/addItem', itemsController.addItem);%0Arouter.get('/a', itemsController.a);%0A%0A*/%0A /* // main routes%0Arouter.get('/client', mainController.showHome);%0Arouter.get('/admin', itemsController.showAllItems);%0Arouter.get('/addItem', itemsController.addItem);%0Arouter.get('/checkQuantity', itemsController.checkQuantity);%0Arouter.get('/deleteItem', itemsController.deleteItem);%0Arouter.get('/deleteAllItem', itemsController.deleteAllItem);%0A%0Arouter.use('/userManage',require('./Controllers/userServerController'));----------%0A%0A%0A%0A/*router.get('*', function(req,res)%7B%0A    res.sendFile(path.join(__dirname , '../public','view/admin/index.html'));%0A%7D);*/%0A%0A//router.get('/createItem',itemsController.createItem);%0A//router.get('/getAllItems',itemsController.getAllItems);
+getProductsOfSubCategory);%0A// export router%0Amodule.exports = router;%0A
 %0A

add routing to getProductsOfSubCategory