rocket hello world stuff

This commit is contained in:
Greg Shuflin 2025-01-29 02:37:20 -08:00
parent 7f0ad405b8
commit 6b9b5eff1d
3 changed files with 1583 additions and 2 deletions

1552
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -5,4 +5,5 @@ edition = "2021"
[dependencies]
atom_syndication = "0.12.6"
rocket = { version = "0.5.1", features = ["json"] }
rss = "2.0.11"

View File

@ -1,3 +1,31 @@
fn main() {
println!("Hello, world!");
#[macro_use] extern crate rocket;
use rocket::serde::{Serialize, json::Json};
#[derive(Serialize)]
#[serde(crate = "rocket::serde")]
struct Message {
a: i32,
b: String,
}
#[get("/message")]
fn message() -> Json<Message> {
Json(Message {
a: -4,
b: "Hallo".to_string()
})
}
#[get("/")]
fn index() -> &'static str {
"yolo swagg"
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![index, message])
}