add user table

This commit is contained in:
2023-03-26 14:40:56 +02:00
parent f01b073654
commit bb8fb03b61
9 changed files with 1477 additions and 9 deletions

27
src/rest/mod.rs Normal file
View File

@ -0,0 +1,27 @@
use rocket::{get, routes, Build, Rocket};
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
}
pub fn start() -> Rocket<Build> {
rocket::build().mount("/", routes![index])
}
#[cfg(test)]
mod test {
use super::start;
use rocket::http::Status;
use rocket::local::blocking::Client;
use rocket::uri;
#[test]
fn hello_world() {
let client = Client::tracked(start()).expect("valid rocket instance");
let response = client.get(uri!(super::index)).dispatch();
assert_eq!(response.status(), Status::Ok);
assert_eq!(response.into_string(), Some("Hello, world!".into()));
}
}