Run hurl tests via cargo (#12)
This allows us to pull them into the coverage report. Reviewed-on: #12 Co-authored-by: Drew Galbraith <drew@tiramisu.one> Co-committed-by: Drew Galbraith <drew@tiramisu.one>
This commit is contained in:
parent
68dbaa32c9
commit
2880391c8c
6 changed files with 805 additions and 32 deletions
3
backend/src/lib.rs
Normal file
3
backend/src/lib.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pub mod database;
|
||||
pub mod models;
|
||||
pub mod services;
|
||||
|
|
@ -8,9 +8,8 @@ mod services;
|
|||
async fn main() {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let binding = database::DatabaseConfig {
|
||||
database_url: "sqlite:local.db".to_string(),
|
||||
};
|
||||
let database_url = std::env::var("DATABASE_URL").unwrap_or("sqlite:local.db".to_string());
|
||||
let binding = database::DatabaseConfig { database_url };
|
||||
let pool = database::create_pool(&binding)
|
||||
.await
|
||||
.expect("Failed to create database pool");
|
||||
|
|
@ -19,7 +18,8 @@ async fn main() {
|
|||
.nest("/api/tasks", services::create_task_router())
|
||||
.with_state(pool);
|
||||
|
||||
let addr = "127.0.0.1:3000";
|
||||
let port = std::env::var("PORT").unwrap_or("3000".to_string());
|
||||
let addr = format!("127.0.0.1:{}", port);
|
||||
|
||||
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue