summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDaniel Hader <[email protected]>2026-05-10 10:15:56 -0500
committerDaniel Hader <[email protected]>2026-05-10 10:15:56 -0500
commita005add5513182abb0b1230cf514c7a45b290e4b (patch)
tree5fb5c249d8828ba62f4ae91cbe0e8b5a440be570 /src/main.rs
database with problem model
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..a143df5
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,26 @@
+mod database;
+mod routes;
+
+use axum::{
+ routing::get,
+ Router,
+};
+
+use routes::problems::get_problems;
+
+#[tokio::main]
+async fn main() {
+ let app = Router::new()
+ .route("/", get(|| async {"Hello World!"}))
+ .route("/problems", get(get_problems));
+
+ let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
+ axum::serve(listener, app).await.unwrap();
+}
+
+#[cfg(test)]
+mod tests {
+ fn test_app() -> String {
+ "hello".into()
+ }
+}