Skip to content

Commit a45aa9f

Browse files
committed
Added basic web application.
1 parent 5d1c746 commit a45aa9f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,20 @@ features = ["color"]
1515

1616
[profile.release]
1717
lto = true
18+
19+
# Web
20+
[dependencies.rocket]
21+
version = "^0.2.6"
22+
optional = true
23+
24+
[dependencies.rocket_codegen]
25+
version = "^0.2.6"
26+
optional = true
27+
28+
[features]
29+
web = ["rocket", "rocket_codegen"]
30+
31+
[[bin]]
32+
name = "web"
33+
path = "src/bin/web.rs"
34+
required-features = ["web"]

src/bin/web.rs

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

0 commit comments

Comments
 (0)