SHARE
TWEET

Untitled

a guest Jun 16th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var express = require('express');
  2. var router = express.Router();
  3.  
  4. /* GET users listing. */
  5. router.get('/', function(req, res, next) {
  6.   res.send('Hey ! It\'s a GET');
  7. });
  8.  
  9. /* GET user with ID. */
  10. router.put('/:name', (req,res) => {
  11.   res.send('Hey my name is' + req.params.name);
  12.  
  13. });
  14.  
  15. /* POST user creation. */
  16. router.delete('/:id(\\d+)', function(req, res, next) {
  17.   res.send("Hey ! It\'s DELETED ID"+req.params.id);
  18. });
  19.  
  20. module.exports = router;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top