Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example #1

Open
ckaminski opened this issue May 15, 2023 · 1 comment
Open

Example #1

ckaminski opened this issue May 15, 2023 · 1 comment

Comments

@ckaminski
Copy link

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.

@jay-johnson
Copy link
Owner

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:

  1. clone the repo locally using https (or fork the repo and then clone it locally)
  2. copy over any local handle_request.rs changes you want into the newly-cloned repo's ./src/handle_request.rs file
  3. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants