Create a new route when visited then a whitelist function should execute

Is it possible to create a route and when the route is visited/hit then a whitelist function should execute,
just like how we do in MVC architecture frameworks like django,express where we will define routers and controllers
when the route is hit then the controller which is assigned to the route will execute
how can we do that in frappe?