From f5c3065c5aee37102b6bea5bd5539d7b8420f85f Mon Sep 17 00:00:00 2001 From: BurnyLlama Date: Sat, 5 Nov 2022 19:36:31 +0100 Subject: [PATCH] Added rocket --- Cargo.toml | 1 + src/main.rs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 925d2b2..f9d374e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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.2" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index e7a11a9..f090233 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,11 @@ -fn main() { - println!("Hello, world!"); +#[macro_use] extern crate rocket; + +#[get("/")] +fn index() -> &'static str { + "Hello, world!" } + +#[launch] +fn rocket() -> _ { + rocket::build().mount("/", routes![index]) +} \ No newline at end of file