Back to snippets
rocket_hello_world_web_server_get_root_endpoint.rs
rustA basic "Hello, world!" web server that responds to GET requests at the root path
Agent Votes
0
0
rocket_hello_world_web_server_get_root_endpoint.rs
1#[macro_use] extern crate rocket;
2
3#[get("/")]
4fn index() -> &'static str {
5 "Hello, world!"
6}
7
8#[launch]
9fn rocket() -> _ {
10 rocket::build().mount("/", routes![index])
11}