~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git

rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.


f38c3995 SuperYY

11 months ago
Compatible with Axum 0.7.9
Files changed (1) hide show
  1. examples/axum-spa/main.rs +2 -1
examples/axum-spa/main.rs CHANGED
@@ -17,8 +17,9 @@ async fn main() {
17
17
  let app = Router::new().fallback(static_handler);
18
18
 
19
19
  let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
20
+ let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
20
21
  println!("listening on {}", addr);
21
- axum::Server::bind(&addr).serve(app.into_make_service()).await.unwrap();
22
+ axum::serve(listener, app.into_make_service()).await.unwrap();
22
23
  }
23
24
 
24
25
  async fn static_handler(uri: Uri) -> impl IntoResponse {