Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * GET users listing. */
- router.get('/', function(req, res, next) {
- res.send('Hey ! It\'s a GET');
- });
- /* GET user with ID. */
- router.get('/:id(\\d+)', function(req, res, next) {
- res.send('Hey ! It\'s a GET with ID ' + req.params.id);
- });
- /* POST user creation. */
- router.post('/', function(req, res, next) {
- res.send('Hey ! It\'s a POST');
- });
- router.put('/:id', function(req, res, next) {
- res.send('Hey ! My name is ' + req.params.id);
- });
Add Comment
Please, Sign In to add comment