run rocket server

This commit is contained in:
Daan Wynen 2022-09-24 11:53:36 +02:00
parent e7244a99eb
commit f5fcba65eb
3 changed files with 1496 additions and 2 deletions

1485
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rocket = "0.5.0-rc.1"

View File

@ -1,3 +1,11 @@
fn main() {
println!("Hello, world!");
use rocket::{get, launch, routes};
#[get("/")]
async fn home() -> String {
String::from("lykin")
}
#[launch]
async fn rocket() -> _ {
rocket::build().mount("/", routes![home])
}