From e905c4263e4fda5891b6f024e40318588c020509 Mon Sep 17 00:00:00 2001 From: Alex Wellnitz Date: Mon, 17 Mar 2025 20:17:50 +0100 Subject: [PATCH] feat: add rocket web-framework --- Cargo.toml | 1 + src/main.rs | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 834eea1..35f2709 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] +rocket = "0.5.0" diff --git a/src/main.rs b/src/main.rs index e7a11a9..aa992e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,13 @@ -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]) +} +