Allow creating and updating tasks on the backend. (#2)

Create hurl tests along with the necessary api code to resolve them.

Reviewed-on: #2
Co-authored-by: Drew Galbraith <drew@tiramisu.one>
Co-committed-by: Drew Galbraith <drew@tiramisu.one>
This commit is contained in:
Drew 2025-09-20 18:49:11 +00:00 committed by Drew
parent 82d524a62f
commit d32f6be813
10 changed files with 306 additions and 28 deletions

View file

@ -1,13 +1,23 @@
use axum::{Router, routing::get};
mod models;
mod database;
mod models;
mod services;
#[tokio::main]
async fn main() {
tracing_subscriber::fmt::init();
let app = Router::new().route("/health", get(health));
let binding = database::DatabaseConfig {
database_url: "sqlite:local.db".to_string(),
};
let pool = database::create_pool(&binding)
.await
.expect("Failed to create database pool");
let app = Router::new()
.route("/health", get(health))
.nest("/api/tasks", services::create_task_router())
.with_state(pool);
let addr = "127.0.0.1:3000";