mirror of
https://gitlab.com/Anson-Projects/shuttle-christmas-code-hunt-2023.git
synced 2025-06-16 07:06:43 +00:00
day -1
This commit is contained in:
parent
90d5e96c21
commit
8754cf5bc1
10
src/main.rs
10
src/main.rs
@ -1,13 +1,21 @@
|
|||||||
use rocket::{get, routes};
|
use rocket::{get, routes};
|
||||||
|
|
||||||
|
use rocket::http::Status;
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
fn index() -> &'static str {
|
fn index() -> &'static str {
|
||||||
"Hello, world!"
|
"Hello, world!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[get("/-1/error")]
|
||||||
|
fn error() -> Status{
|
||||||
|
Status::InternalServerError
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#[shuttle_runtime::main]
|
#[shuttle_runtime::main]
|
||||||
async fn main() -> shuttle_rocket::ShuttleRocket {
|
async fn main() -> shuttle_rocket::ShuttleRocket {
|
||||||
let rocket = rocket::build().mount("/", routes![index]);
|
let rocket = rocket::build().mount("/", routes![index, error]);
|
||||||
|
|
||||||
Ok(rocket.into())
|
Ok(rocket.into())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user