Skip to content

Instantly share code, notes, and snippets.

@thulioph
Created March 14, 2015 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thulioph/446ccc7ab9059678203c to your computer and use it in GitHub Desktop.
Save thulioph/446ccc7ab9059678203c to your computer and use it in GitHub Desktop.
ap
var express = require('express');
var router = express.Router();
var Controller = require('../controller');
// Create - enviar
router.post('/', function(req, res, next) {
Controller.create(req, res);
});
// Retrieve - pegar
router.get('/', function(req, res, next) {
Controller.retrieve(req, res);
});
router.get('/:id', function(req, res, next) {
Controller.get(req, res);
});
// Update - alterar
router.put('/:id', function(req, res, next) {
Controller.update(req, res);
});
// Delete - remover
router.delete('/:id', function(req, res, next) {
Controller.delete(req, res);
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment