I’m just starting to learn rust and as a learning project - after reading half of the “Programming Rust” Oreilly book - I’m trying to build some kind of pow/puma-dev but not specific to rails (that means serve local directories and reverse proxy local ports).
The main trick is that I have to first have an http request to match the
Host header against state for the required action. One way to handle it is to have one handler with access to mutable state so it can compare the request to the state and decide on an action. This is how I’m trying it now and it brings the challenge of incompatible types from all the branches of the actions (I already have a question about it in the forum). The second way I can think of is to use a higher level framework, construct the routes/responses in advance based on the saved state and handle requests accordingly. This could be nicer and easier to work with, but updating the state will not change the behaviour of the running server (as the routes are already configured). I was wondering is there a web framework that runs on stable that allows for hot-swapping or updating the current app/routes?
Thanks in advance