Issue one make verbs matter#2
Merged
jrkosinski merged 4 commits intojrkosinski:v0.0.2from Mar 2, 2026
Merged
Conversation
…why this went down the way it did
…ign docs - Replace DI container with RouterPipeline (Kleisli composition via >=>) - Bake HTTP verb into route constant as (&str, &str) tuple — enforced by mount_handlers! - Add middleware.rs: require_bearer (constant-time bearer auth as Router->Router transform) and guard (predicate-based request filter) - Add pipeline combinators: mount_if, mount_guarded, group, fold, layer_all - Strip axum from user crate surface — all types re-exported via rust_api::prelude::* - Add basic-api example: group, mount_if, mount_guarded, require_bearer in action - Add .cursor/rules/rust-api-design.mdc (alwaysApply design invariants) - Add docs/CompositionalRefactor.md (design rationale, NestJS comparison, next steps)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ok - so this is a toe in the water refactor of the way the router works - see docs/CompositionalRefcator.md for the reasoning and benefits of the approach. DI containers seem a bit heavy to me for composing services and controllers, I changed things up so the router is built from a pipeline and wrapped in Result, its Result all the way down. I did not really add any unit tests or anything - but it will be easy to do that as the controllers are pure now, so they are isolated and testable. Anyhoo - have a look see, if you like where this is going I can add tests and build out validations with tests. If you would prefer not to that is ok as well, but be waned I may continue with this fork and see how far I can push rust to use my FP ways. Me and my arrow!