Migrate from Trillium [part 2]: Axum scaffold and proxy fallback - #2197
Merged
Conversation
Establish dual-server infrastructure for incremental route migration. Trillium remains the primary listener; a proxy handler at the end of the handler chain forwards unmatched requests to a local Axum server. - Add axum, reqwest, and tower-http dependencies to the main crate - Define AxumAppState struct (Db + Arc<Config>) for the Axum side - Spawn an Axum server on an ephemeral loopback port in DivviupApi::new() with a TraceLayer for request-level tracing - Add AxumProxy handler that forwards unhalted Trillium requests to the local Axum server via reqwest (trillium-proxy is incompatible with trillium 0.2.x, so we use a custom handler like Janus did) - Wire the proxy into the handler chain just before ErrorHandler - Add /internal/test/axum_ready endpoint and integration test to verify the proxy bridge works end-to-end
jcjones
commented
Apr 14, 2026
| let url = if querystring.is_empty() { | ||
| format!("{}{}", self.upstream, path) | ||
| } else { | ||
| format!("{}{}?{}", self.upstream, path, querystring) |
Contributor
Author
There was a problem hiding this comment.
query strings are used for pagination, so plumbed it through
jcjones
marked this pull request as ready for review
April 14, 2026 02:51
tgeoghegan
approved these changes
Apr 14, 2026
divergentdave
approved these changes
Apr 14, 2026
| &self.config.crypter | ||
| } | ||
|
|
||
| #[allow(dead_code)] // Scaffolded for later migration parts. |
Collaborator
There was a problem hiding this comment.
We could try this, so the compiler will check that we clean this up in the future.
Suggested change
| #[allow(dead_code)] // Scaffolded for later migration parts. | |
| #[expect(dead_code)] // Scaffolded for later migration parts. |
| handler: Box<dyn Handler>, | ||
| db: Db, | ||
| config: Arc<Config>, | ||
| #[handler(skip)] |
Collaborator
There was a problem hiding this comment.
It looks like this attribute doesn't do anything. See https://docs.rs/trillium-macros/latest/src/trillium_macros/handler.rs.html#92-122
Contributor
Author
There was a problem hiding this comment.
That seems like it should have raised a complication error. Huh.
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.
Establish dual-server infrastructure for incremental route migration. Trillium remains the primary listener; a proxy handler at the end of the handler chain forwards unmatched requests to a local Axum server.