Compare commits

..

No commits in common. "bcdbcef6366d31fa9f57b2de1e722eb8215c2eb1" and "5b51404a4c76315e9fdac8748603040df6020de2" have entirely different histories.

4 changed files with 11 additions and 804 deletions

View File

@ -1,4 +0,0 @@
:2000 {
reverse_proxy 127.0.0.1:5173
reverse_proxy /api/* 127.0.0.1:3000
}

804
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -8,4 +8,3 @@ poem = { version = "1.3.58", features = ["websocket"]}
tokio = { version = "1.17.0", features = ["rt-multi-thread", "macros"] }
futures-util = "0.3.17"
tracing-subscriber = { version ="0.3.9", features = ["env-filter"] }
sqlx = { version = "0.7.2", features = ["runtime-tokio", "sqlite"] }

View File

@ -42,7 +42,7 @@ fn index() -> Html<&'static str> {
sendForm.hidden = false;
msgsArea.hidden = false;
msgInput.focus();
ws = new WebSocket("ws://127.0.0.1:2000/api/ws/" + nameInput.value);
ws = new WebSocket("ws://127.0.0.1:3000/ws/" + nameInput.value);
ws.onmessage = function(event) {
msgsArea.value += event.data + "\r\n";
}
@ -97,8 +97,8 @@ async fn main() -> Result<(), std::io::Error> {
}
tracing_subscriber::fmt::init();
let app = Route::new().at("/api/", get(index)).at(
"/api/ws/:name",
let app = Route::new().at("/", get(index)).at(
"/ws/:name",
get(ws.data(tokio::sync::broadcast::channel::<String>(32).0)),
);