Hello guys, how r u doing?
I’m trying to realize, how can i create a route with optional pieces, not only parameters, or without having to create 2 routes for the same method.
... Route.get('/categories/page/:page?', 'ContentController@categories').as('categories.index') ...
So, if the visitor specify which page he wants to see, i’ll serve the correct paginated content for him, else, i’ll serve the first page of the listing, which can be done as the following.
... Route.get('/categories', 'ContentController@categories').as('categories.index') ...
Is there any way to do this using AdonisJS built-in functions?