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

Investigate "method" routing #12

Open
1 of 6 tasks
CathalMullan opened this issue Aug 2, 2024 · 0 comments · May be fixed by #209
Open
1 of 6 tasks

Investigate "method" routing #12

CathalMullan opened this issue Aug 2, 2024 · 0 comments · May be fixed by #209

Comments

@CathalMullan
Copy link
Contributor

CathalMullan commented Aug 2, 2024

Need to be able to support any number of methods, or all.

Custom methods too.
Maybe we can create a quick path for standard methods, then custom methods can use a seperate path?

So our search should be able to handle:

  • no method filter
  • single method
  • methods
  • all methods

For method routing specifically, we need to support the "Method Not Supported" response too.

We'll want to abstract over data storage - e.g. data can be stored inline as T/Arc at any layer.

Do we want to support route without a path?
Yes - why not.

Annoying that http::Request isn't no_std compatible.
UPDATE: Well now it is: https://github.com/DuskSystems/http

Conflict handling may be tricky.

Should update the GitLab examples to use method.

let mut router = Router::new();
router.path.constraint::<C>();

let route = Routable::builder()
    // or: .methods(vec![..])
    .method(Method::GET) 
    .method(Method::HEAD)
    .route("/users/{id}")
    .build();

router.insert(route, handle_users_by_id)?;

Before we tackle this - we should:

  • setup a request builder
  • move existing router to be named path router
  • create a top-level meta router
  • change match to support multiple matching routing targets
  • setup a route builder
  • add a better abstraction over data storage (i.e. data should be top-level, not per router)
@CathalMullan CathalMullan pinned this issue Aug 21, 2024
@CathalMullan CathalMullan unpinned this issue Sep 5, 2024
@CathalMullan CathalMullan linked a pull request Oct 28, 2024 that will close this issue
4 tasks
@CathalMullan CathalMullan pinned this issue Nov 14, 2024
This was linked to pull requests Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant