use crate::{handlers, routes, spa, AppConfig, AppState};
use trillium::{Handler, State};
use trillium_conn_id::ConnId;
use trillium_logger::{apache_combined, Logger};
use trillium_router::Router;
pub async fn app(config: AppConfig) -> impl Handler {
(
State::new(AppState::from_config(config).await.unwrap()),
handlers::remove_server_response_header,
ConnId::new(),
Logger::new().with_formatter(apache_combined(
trillium_conn_id::log_formatter::conn_id,
"-",
)),
Router::new().get("/api/*", routes::not_found),
spa(),
)
}