Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Delete.js
var express = require('express');
var router = express.Router();
//PUT
router.get('/:nom((\[a-z]+))', function (req, res, next) {
res.render('update-user', {
id: req.params.nom
});
});
router.put('/:nom((\[a-z]+))', function (req, res, next) {
res.send('The new name is ' + req.params.nom)
});
//DELETE
router.get('/:numero(\\d+)', function (req, res, next) {
res.render('delete-user', {
num: req.params.numero
});
});
router.delete('/:numero(\\d+)', function (req, res, next) {
res.send('No more user ' + req.params.numero)
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment