fix: resolve module naming conflict and router type issues
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -64,13 +64,15 @@ async fn run_server(
|
|||||||
ServiceBuilder::new()
|
ServiceBuilder::new()
|
||||||
.layer(TraceLayer::new_for_http())
|
.layer(TraceLayer::new_for_http())
|
||||||
.layer(CorsLayer::permissive())
|
.layer(CorsLayer::permissive())
|
||||||
)
|
);
|
||||||
.with_state(state);
|
|
||||||
|
|
||||||
// Add API and documentation routes
|
// Add API and documentation routes
|
||||||
let app = api::add_routes(app);
|
let app = api::add_routes(app);
|
||||||
let app = docs::add_routes(app);
|
let app = docs::add_routes(app);
|
||||||
|
|
||||||
|
// Apply state to the router after all routes are added
|
||||||
|
let app = app.with_state(state);
|
||||||
|
|
||||||
let addr: SocketAddr = if config.address.starts_with('/') || config.address.starts_with("./") {
|
let addr: SocketAddr = if config.address.starts_with('/') || config.address.starts_with("./") {
|
||||||
// Unix socket - not supported by axum directly, fall back to TCP
|
// Unix socket - not supported by axum directly, fall back to TCP
|
||||||
warn!("Unix sockets not yet implemented, falling back to TCP on 127.0.0.1:8080");
|
warn!("Unix sockets not yet implemented, falling back to TCP on 127.0.0.1:8080");
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
pub mod item;
|
pub mod item;
|
||||||
pub mod status;
|
pub mod status;
|
||||||
pub mod routes;
|
mod routes;
|
||||||
|
|
||||||
|
pub use routes::add_routes;
|
||||||
|
|||||||
Reference in New Issue
Block a user