restapi
restapi copied to clipboard
Example
Is there an example about extending handle_request?
I haven't been able to find an API I can add my own paths to the handle_request loop.
Hello and thanks for checking out the repo!
This is a great question. Unfortunately the current design/api does not support extending or customizing the src/handle_request.rs to handle different url routes. I'll have to look around at how other hyper frameworks handle that type of support/use case. Let me know if you have any ideas too.
Since customizing the handle_request.rs is not supported for now, I would:
- clone the repo locally using https (or fork the repo and then clone it locally)
- copy over any local handle_request.rs changes you want into the newly-cloned repo's ./src/handle_request.rs file
- build the crate and run the server
cargo build --example server && export RUST_BACKTRACE=1 && export RUST_LOG=info,kafka_threadpool=info && ./target/debug/examples/server
Hope that helps!