Guest User

Untitled

a guest
Dec 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. * GET users listing. */
  2. router.get('/', function(req, res, next) {
  3. res.send('Hey ! It\'s a GET');
  4. });
  5.  
  6. /* GET user with ID. */
  7. router.get('/:id(\\d+)', function(req, res, next) {
  8. res.send('Hey ! It\'s a GET with ID ' + req.params.id);
  9. });
  10.  
  11. /* POST user creation. */
  12. router.post('/', function(req, res, next) {
  13. res.send('Hey ! It\'s a POST');
  14. });
  15.  
  16. router.put('/:id', function(req, res, next) {
  17. res.send('Hey ! My name is ' + req.params.id);
  18. });
Add Comment
Please, Sign In to add comment