summaryrefslogtreecommitdiff
path: root/src/routes/problem.rs
diff options
context:
space:
mode:
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])
+}
+