summaryrefslogtreecommitdiff
path: root/src/routes/problem.rs
diff options
context:
space:
mode:
authorDaniel Hader <[email protected]>2026-05-11 19:28:00 -0500
committerDaniel Hader <[email protected]>2026-05-11 19:28:00 -0500
commit36fad793c3be58b220ae319a45c8cd8afbae09fa (patch)
tree0f072c9f3dd45b4295ded00d8a7f2c318238b688 /src/routes/problem.rs
parenta005add5513182abb0b1230cf514c7a45b290e4b (diff)
user route and database pooling using r2d2
Diffstat (limited to 'src/routes/problem.rs')
-rw-r--r--src/routes/problem.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/routes/problem.rs b/src/routes/problem.rs
new file mode 100644
index 0000000..caeb808
--- /dev/null
+++ b/src/routes/problem.rs
@@ -0,0 +1,17 @@
+use axum::response::Json;
+use serde::Serialize;
+
+#[derive(Serialize)]
+pub struct Problem {
+ title: String,
+ description: String,
+}
+
+pub async fn get_problems() -> Json<Vec<Problem>> {
+ let problem = Problem {
+ title: "test problem".into(),
+ description: "the description of a test problem".into(),
+ };
+ Json(vec![problem])
+}
+