Currently, I am working on a small rocket.rs web application.
I am struggling by declaring routes and catchers in a separate module. The setup of the rocket seems to be a bit uncomfortable, and I would like to ask, if there is a better way to handle this.
All my routes are declared as public functions in module
routes. My catchers are declared as public functions in
Now my question is, if it is possible to add the whole module as a route source instead of each function in it explicitly. This is how my
run() function looks like:
rocket.mount("/", routes![routes::route_a, routes::routes_b, ....]) .register(catchers![catchers::_404, catchers::_500]) .launch()
I'd like to have something like this:
rocket.mount("/", routes![routes]) [...]
It would be great, if someone could help me out.