port 3111
This commit is contained in:
+8
-5
@@ -1,10 +1,10 @@
|
|||||||
mod state;
|
|
||||||
mod handlers;
|
mod handlers;
|
||||||
mod models;
|
mod models;
|
||||||
|
mod state;
|
||||||
|
|
||||||
use axum::{
|
use axum::{
|
||||||
routing::{get, post},
|
|
||||||
Router,
|
Router,
|
||||||
|
routing::{get, post},
|
||||||
};
|
};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tower_http::services::ServeDir;
|
use tower_http::services::ServeDir;
|
||||||
@@ -30,14 +30,17 @@ async fn main() {
|
|||||||
.route("/ws/agent/:agent_id", get(handlers::ws::agent_ws))
|
.route("/ws/agent/:agent_id", get(handlers::ws::agent_ws))
|
||||||
.route("/messages/:session_id", get(handlers::chat::get_messages))
|
.route("/messages/:session_id", get(handlers::chat::get_messages))
|
||||||
.route("/send/:session_id", post(handlers::chat::send_message))
|
.route("/send/:session_id", post(handlers::chat::send_message))
|
||||||
.route("/agent/send/:session_id", post(handlers::chat::agent_send_message))
|
.route(
|
||||||
|
"/agent/send/:session_id",
|
||||||
|
post(handlers::chat::agent_send_message),
|
||||||
|
)
|
||||||
.route("/sessions", get(handlers::chat::get_sessions))
|
.route("/sessions", get(handlers::chat::get_sessions))
|
||||||
.route("/sessions/new", post(handlers::chat::new_session))
|
.route("/sessions/new", post(handlers::chat::new_session))
|
||||||
.nest_service("/static", ServeDir::new("static"))
|
.nest_service("/static", ServeDir::new("static"))
|
||||||
.with_state(state);
|
.with_state(state);
|
||||||
|
|
||||||
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
|
let listener = tokio::net::TcpListener::bind("0.0.0.0:3111").await.unwrap();
|
||||||
tracing::info!("Chat service running — http://0.0.0.0:3000");
|
tracing::info!("Chat service running — http://0.0.0.0:3111");
|
||||||
axum::Server::from_tcp(listener.into_std().unwrap())
|
axum::Server::from_tcp(listener.into_std().unwrap())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.serve(app.into_make_service())
|
.serve(app.into_make_service())
|
||||||
|
|||||||
Reference in New Issue
Block a user