1

I have a Rust app and I'd like to store routes in a database (it can be an in-memory mock for all I care), but I want to update routes at runtime. I'm ignoring a 404 route or other status routes and assuming anything off the root route of "/" would be fair game for the user to create. That means the user could create "/hello/world/test" and "/hello2/again/test" with no real pattern. Most examples I see asume there will be a pattern.

The idea is that the user would be able to eventually define a route and Rust module and function in the database and then when that route is hit, it would load the function. All the examples I found assume that the routes are known at compile time or follow a pattern.

If hyper is not the framework I should be using let me know.

Thanks!

chum of chance
  • 6,200
  • 10
  • 46
  • 74
  • 2
    I'd say _Rust_ is probably not the language you should be using. Rust is a compiled language, which makes it very difficult to have the user "define a Rust module" at run-time. – Jmb Aug 22 '21 at 07:53
  • I think I expressed it wrong. I want the user to define routes at runtime. Eventually I would like the user to connect the routes to compiled code... but at runtime. So if I could compile code that would simply return "Hello world" and then in my main application reference that lib. But in any case looking for routes defined at runtime now. – chum of chance Aug 22 '21 at 08:02

0 Answers0