aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCurly Bryce <curlybryce@protonmail.com>2024-07-02 19:20:52 -0600
committerCurly Bryce <curlybryce@protonmail.com>2024-07-02 19:20:52 -0600
commitf2452bd9d69ff197465303e35a2199de7984474d (patch)
treeccbe43528846a12dbaf607bb14e54db76837c35c /src
parent88b1ad3beb7c4ab728b9995edec708db17d930e9 (diff)
downloadpoko_server-f2452bd9d69ff197465303e35a2199de7984474d.tar.gz
poko_server-f2452bd9d69ff197465303e35a2199de7984474d.tar.bz2
poko_server-f2452bd9d69ff197465303e35a2199de7984474d.zip
remove test code
Diffstat (limited to 'src')
-rw-r--r--src/main.rs33
1 files changed, 1 insertions, 32 deletions
diff --git a/src/main.rs b/src/main.rs
index c3fcf91..859c4d3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -110,27 +110,6 @@ impl DB {
}
}
-#[derive(Debug, Serialize)]
-struct TextResponse {
- message: String
-}
-impl From<&'static str> for TextResponse {
- fn from(value: &'static str) -> Self {
- TextResponse{message: value.into()}
- }
-}
-
-#[derive(Debug, Deserialize)]
-struct InputForm {
- user: String,
- password: String,
-}
-impl InputForm {
- pub fn login(&self) -> bool {
- self.user == self.password
- }
-}
-
#[get("/")]
async fn index() -> &'static str {
"This is a POKO server"
@@ -179,17 +158,7 @@ async fn new_user(data: Json<UserForm>, db: &State<Mutex<DB>>) -> Json<Result<()
}
}
-#[post("/", data="<body>", format="json")]
-async fn posttest(body: Json<InputForm>) -> Json<TextResponse> {
- println!("{:?}", body);
- if body.login() {
- TextResponse::from("Equal").into()
- } else {
- TextResponse::from("Not Equal").into()
- }
-}
-
#[launch]
fn rocket() -> _ {
- rocket::build().manage(Mutex::new(DB::load())).mount("/", routes![index, posttest, new_user, get_user])
+ rocket::build().manage(Mutex::new(DB::load())).mount("/", routes![index, new_user, get_user])
} \ No newline at end of file