~repos /rust-embed
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
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::
|
|
22
|
+
axum::serve(listener, app.into_make_service()).await.unwrap();
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
async fn static_handler(uri: Uri) -> impl IntoResponse {
|