format: separate routes in file system

This commit is contained in:
2026-04-10 12:08:03 +02:00
parent 6dc7231309
commit db14d816cb
3 changed files with 47 additions and 42 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
pub mod chat;
pub mod models;
use crate::auth::middleware::auth_middleware;
@@ -7,7 +8,7 @@ use axum::{Router, middleware, routing::get, routing::post};
pub fn router() -> Router<AppState> {
Router::new()
.route("/models", get(models::list_models))
.route("/completions", post(models::completions))
.route("/chat/completions", post(models::chat_completions))
.route("/completions", post(chat::completions))
.route("/chat/completions", post(chat::chat_completions))
.layer(middleware::from_fn(auth_middleware))
}