Set up monorepo Docker development
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
use crate::models::transaction::Transaction;
|
||||
|
||||
pub fn create_router() -> axum::Router {
|
||||
axum::Router::new().route("/", axum::routing::get(get_transactions))
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
pub async fn get_transactions() -> axum::Json<Vec<Transaction>> {
|
||||
axum::Json(vec![
|
||||
Transaction {
|
||||
id: uuid::Uuid::new_v4(),
|
||||
description: "Groceries".to_string(),
|
||||
amount: 42.50,
|
||||
date: chrono::Utc::now(),
|
||||
},
|
||||
Transaction {
|
||||
id: uuid::Uuid::new_v4(),
|
||||
description: "Coffee".to_string(),
|
||||
amount: 4.25,
|
||||
date: chrono::Utc::now(),
|
||||
},
|
||||
])
|
||||
}
|
||||
Reference in New Issue
Block a user