summaryrefslogtreecommitdiff
path: root/server/src/main.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-08-22 17:04:48 +0200
committerSanto Cariotti <santo@dcariotti.me>2022-08-22 17:04:48 +0200
commitbb186c0d67139f076ca8ec1aa99ac0841b3036f3 (patch)
tree16d7b46a53527fed2ab6fbbd1ab6f421311c514e /server/src/main.rs
parent78c3d9f61e2087cd09fdd36f002f910a4394c7f3 (diff)
Get all users
Diffstat (limited to 'server/src/main.rs')
-rw-r--r--server/src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index 3b080eb..8319fb2 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -1,6 +1,7 @@
mod db;
mod errors;
mod logger;
+mod models;
use axum::{
http::{header, Request},
@@ -52,8 +53,9 @@ async fn create_app() -> Router {
}
// Example root which says hi
-async fn hej() -> Result<Json<Hej>, errors::AppError> {
- Ok(Json(Hej::new("hej verden".to_string())))
+async fn hej() -> Result<Json<Vec<models::users::User>>, errors::AppError> {
+ let users = models::users::User::list().await?;
+ Ok(Json(users))
}
#[derive(Debug, Serialize)]