1
0
Fork 0
Rust-Rocket-Project/src/controllers/mod.rs
2021-07-08 23:29:40 +02:00

17 lines
No EOL
313 B
Rust

use rocket::{get, catch};
use rocket::serde::json::{Value, json};
pub mod tasks_controller;
#[get("/")]
pub fn index() -> &'static str {
"Hello, world!"
}
#[catch(404)]
pub fn not_found() -> Value {
json!({
"status": "error",
"reason": "Resource was not found."
})
}