@@ -327,26 +327,26 @@ app.get('/', function (req, res) {
3273278 . <b >Route paths</b >
328328 a. Route paths, in combination with a request method, define the endpoints at which requests can be made.
329329 b. The characters ?, +, * , and () are subsets of their regular expression counterparts
330- c. The route path will match requests to /contacts. <br />< br />
330+ c. The route path will match requests to /contacts. <br />
331331
332332app.get('/about', function (req, res) {
333333 res.send('about')
334334 })
335335
336- 9 . This route path will match acd and abcd. Either b or not.<br />< br />
336+ 9 . This route path will match acd and abcd. Either b or not.<br />
337337
338338app.get('/ab?cd', function (req, res) {
339339 res.send('ab?cd')
340340 })
341341
342342 10 . This route path will match abcd, abxcd, abRANDOMcd, ab123cd, and so on.
343- front (ab) and last(cd) and in between any random text you can put.<br />< br />
343+ front (ab) and last(cd) and in between any random text you can put.<br />
344344
345345app.get('/ab* cd', function (req, res) {
346346 res.send('ab* cd')
347347 })
348348
349- 11 . This route path will match abcd, abbcd, abbbcd, and so on. You can place mutiple time b.<br />< br />
349+ 11 . This route path will match abcd, abbcd, abbbcd, and so on. You can place mutiple time b.<br />
350350 app.get('/ab+cd', function (req, res) {
351351 res.send('ab+cd')
352352 })
@@ -355,29 +355,29 @@ app.get('/ab*cd', function (req, res) {
355355 Passing the parameter on Route URL
356356 You need to define the Route URL like below.
357357 Input http://localhost:4000/users/50
358- output {"userId":"50"}<br />< br />
358+ output {"userId":"50"}<br />
359359
360360 app.get('/users/: userId ', function (req, res) {
361361 res.send(req.params)
362362})
363363
364364
365- 13 . If you want passing value whould not mandatory than you can use<br />< br />
365+ 13 . If you want passing value whould not mandatory than you can use<br />
366366app.get('/users/: userId ?', function (req, res) {
367367 res.send(req.params)
368368})
369369
37037014 . You can pass the mutiple paramnter on route URL as like below.
371371Input http://localhost:4000/users/50/books/5
372- Output {"userId":"50","bookId":"5"} <br />< br />
372+ Output {"userId":"50","bookId":"5"} <br />
373373
374374 app.get('/users/: userId /books/: bookId ', function (req, res) {
375375 res.send(req.params)
376376 })
377377
378378 15 . You can seperate the parameters also by using -
379379 Input value for that http://localhost:4000/flights/hyderabad-Cg
380- output {"from":"hyderabad","to":"Cg"} <br />< br />
380+ output {"from":"hyderabad","to":"Cg"} <br />
381381
382382 app.get('/flights/:from-: to ', function (req, res) {
383383 res.send(req.params)
0 commit comments