Implement post /api/user endpoint

This commit is contained in:
Ethan O'Brien
2024-02-26 20:38:53 -06:00
parent 9f28840c77
commit f20e948f16
2 changed files with 43 additions and 1 deletions

View File

@@ -21,6 +21,9 @@ async fn dummy_login(req: HttpRequest, body: String) -> HttpResponse { router::l
#[get("/api/user")]
async fn user(req: HttpRequest) -> HttpResponse { router::user::user(req) }
#[post("/api/user")]
async fn user_post(req: HttpRequest, body: String) -> HttpResponse { router::user::user_post(req, body) }
#[post("/api/user/initialize")]
async fn user_initialize(req: HttpRequest, body: String) -> HttpResponse { router::user::initialize(req, body) }
@@ -89,6 +92,7 @@ async fn main() -> std::io::Result<()> {
.service(home)
.service(start_assethash)
.service(user)
.service(user_post)
.service(dummy_login)
.default_service(web::route().to(log_unknown_request)))
.bind(("0.0.0.0", 8080))?