Create target/static before compiling

This commit is contained in:
Joscha 2023-08-03 15:17:22 +02:00
parent 658c523e9c
commit 2dc13cc841
2 changed files with 57 additions and 2 deletions

View file

@ -1,3 +1,18 @@
fn main() {
println!("Hello, world!");
use axum::{routing::get, Router};
async fn run() -> anyhow::Result<()> {
let app = Router::new().route("/", get(|| async { "Hello, world!" }));
axum::Server::bind(&"0.0.0.0:8000".parse().unwrap())
.serve(app.into_make_service())
.await?;
Ok(())
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Rust-analyzer struggles analyzing code in this function, so the actual
// code lives in a different function.
run().await
}