352ad11bc4
Production real-profile content is loaded via an explicit path, NOT the dev-only OPENFUT_DEV_CONTENT_GAMES gate: - Config.content_packs from env OPENFUT_CONTENT_PACKS (comma-sep file paths). - CardDb::load_pack(path): merge an explicit CardDefinition[] production pack. - app::build loads dev packs then production packs. Preflight (app::build, always on): every owned_cards.card_id MUST resolve to a loaded CardDefinition. A real profile with owned players but even ONE missing definition fails LOUDLY instead of silently serving an empty /collection; an empty owned_cards table (fresh DB / tests) passes. 2 preflight integration tests (missing def fails, loaded def passes). clippy -D warnings clean; full suite 151 tests green.
29 lines
728 B
Rust
29 lines
728 B
Rust
pub mod app;
|
|
pub mod config;
|
|
pub mod db;
|
|
pub mod error;
|
|
pub mod extractors;
|
|
pub mod middleware;
|
|
pub mod modding;
|
|
pub mod models;
|
|
pub mod routes;
|
|
pub mod seed;
|
|
pub mod services;
|
|
|
|
use anyhow::Result;
|
|
use axum::Router;
|
|
|
|
/// Build the full Axum application with a provided pool and data directory.
|
|
/// Used by tests to create in-process app instances.
|
|
pub async fn build_app(pool: db::Pool, data_dir: &str) -> Result<Router> {
|
|
let cfg = config::Config {
|
|
listen_addr: "127.0.0.1:0".into(),
|
|
database_url: "sqlite::memory:".into(),
|
|
data_dir: data_dir.to_string(),
|
|
max_connections: 1,
|
|
dev_content_games: Vec::new(),
|
|
content_packs: Vec::new(),
|
|
};
|
|
app::build(pool, cfg).await
|
|
}
|