Skeleton MVC Crud Node Js + Express Js + MongoDB - 4ta Parte


 

/* begin /routes/index.js */


var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/'function(reqresnext) {
  res.render('index', { title: 'Express' });
});

module.exports = router;


 /* end/routes/index.js */

 /* begin /routes/products.js */

var express = require('express');
var router = express.Router();

var product = require('../controllers/ProductController.js');

router.get('/'product.list);
router.get('/show/:id'product.show);
router.get('/create'product.create);
router.post('/save'product.save);
router.get('/edit/:id'product.edit);
router.post('/update/:id'product.update);
router.post('/delete/:id'product.delete);

module.exports = router;

 /* end /routes/products.js */

 /* begin /routes/users.js */


var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/'function(reqresnext) {
  res.send('respond with a resource');
});

module.exports = router;


 /* end /routes/users.js */




Comentarios

Entradas populares