Use caddy for dev server

This commit is contained in:
Lucas Schumacher 2023-10-26 10:33:02 -04:00
parent db5aa38ccb
commit 5c99ee71e3
2 changed files with 6 additions and 2 deletions

4
Caddyfile Normal file
View File

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

View File

@ -97,8 +97,8 @@ async fn main() -> Result<(), std::io::Error> {
}
tracing_subscriber::fmt::init();
let app = Route::new().at("/", get(index)).at(
"/ws/:name",
let app = Route::new().at("/api/", get(index)).at(
"/api/ws/:name",
get(ws.data(tokio::sync::broadcast::channel::<String>(32).0)),
);