Skip to content

Commit 5b49d88

Browse files
committed
feat: Implement first Rocket application
1 parent 56e2b75 commit 5b49d88

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7+
rocket = "0.5.1"

src/main.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
fn main() {
2-
println!("Hello, world!");
1+
#[macro_use]
2+
extern crate rocket;
3+
4+
#[get("/")]
5+
fn index() -> &'static str {
6+
"Hello, world!"
7+
}
8+
9+
#[launch]
10+
fn rocket() -> _ {
11+
rocket::build().mount("/", routes![index])
312
}

0 commit comments

Comments
 (0)