Create target/static before compiling
This commit is contained in:
parent
658c523e9c
commit
2dc13cc841
2 changed files with 57 additions and 2 deletions
19
src/main.rs
19
src/main.rs
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue