Nested route parameters


please help me out that how we can pass multiple parameters in routes.


What have you tried so far?


This is an example about passing multiple parameters to a route and showing them after it

First we declare our Route in this way

Route.get('/about/:name/:age', 'DemoController.index')


  • As you see we have two params: name and age
  • We send this info an index method inside our DemoController

After in our DemoController we make the following

'use strict'

class DemoController {
    async index({ params }){
        let { name, age } = params
        return `${name} ${age}`

module.exports = DemoController

  • As you see we use the params object to get the values sended by the user
  • After with destructuring we parse the data and assing every value to an specific variable
  • After we show them with the return action

Finally this will be a result in our web browser



The result will be

virk 20


Thank you so much sir… this help me out


please if the answer was helpful; please mark it as the correct one