diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs index 108a42f..817bda7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,8 +4,8 @@ use tide::{Request, Response}; pub mod database; mod frontend; mod indieauth; -mod micropub; mod metrics; +mod micropub; use crate::indieauth::IndieAuthMiddleware; use crate::micropub::CORSMiddleware; @@ -110,21 +110,25 @@ pub async fn get_app_with_file( } #[cfg(test)] -pub async fn get_app_with_test_file(token_endpoint: surf::Url) -> ( +pub async fn get_app_with_test_file( + token_endpoint: surf::Url, +) -> ( tempdir::TempDir, database::FileStorage, - App<database::FileStorage> + App<database::FileStorage>, ) { use surf::Url; let tempdir = tempdir::TempDir::new("file").expect("Failed to create tempdir"); - let backend = database::FileStorage::new(tempdir.path().to_path_buf()).await.unwrap(); + let backend = database::FileStorage::new(tempdir.path().to_path_buf()) + .await + .unwrap(); let app = tide::with_state(ApplicationState { token_endpoint, media_endpoint: None, authorization_endpoint: Url::parse("https://indieauth.com/auth").unwrap(), storage: backend.clone(), internal_token: None, - http_client: surf::Client::new() + http_client: surf::Client::new(), }); (tempdir, backend, equip_app(app)) } |