run rocket server
This commit is contained in:
parent
e7244a99eb
commit
f5fcba65eb
File diff suppressed because it is too large
Load Diff
|
@ -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.1"
|
||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -1,3 +1,11 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use rocket::{get, launch, routes};
|
||||
|
||||
#[get("/")]
|
||||
async fn home() -> String {
|
||||
String::from("lykin")
|
||||
}
|
||||
|
||||
#[launch]
|
||||
async fn rocket() -> _ {
|
||||
rocket::build().mount("/", routes![home])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue