2024-12-29 16:51:34 +01:00
|
|
|
use archive::WebsiteArchive;
|
|
|
|
use rocket::routes;
|
|
|
|
|
|
|
|
mod archive;
|
2024-12-29 20:13:15 +01:00
|
|
|
mod blacklist;
|
2024-12-29 18:33:30 +01:00
|
|
|
mod favicon;
|
2024-12-29 19:35:56 +01:00
|
|
|
mod pages;
|
2024-12-29 16:51:34 +01:00
|
|
|
|
|
|
|
#[rocket::launch]
|
|
|
|
async fn launch() -> _ {
|
|
|
|
env_logger::init();
|
|
|
|
|
|
|
|
let arc = WebsiteArchive::new("./websites");
|
|
|
|
|
2024-12-29 20:13:15 +01:00
|
|
|
let archive = arc.clone();
|
|
|
|
|
|
|
|
tokio::spawn(async move {
|
|
|
|
favicon::download_favicons_for_sites(&archive.domains()).await;
|
|
|
|
});
|
2024-12-29 18:33:30 +01:00
|
|
|
|
2024-12-29 16:51:34 +01:00
|
|
|
rocket::build()
|
2024-12-29 18:18:01 +01:00
|
|
|
.mount(
|
|
|
|
"/",
|
|
|
|
routes![
|
|
|
|
pages::index,
|
|
|
|
pages::render_website,
|
2024-12-29 18:33:30 +01:00
|
|
|
pages::domain_info_route,
|
|
|
|
pages::favicon_route
|
2024-12-29 18:18:01 +01:00
|
|
|
],
|
|
|
|
)
|
2024-12-29 16:51:34 +01:00
|
|
|
.manage(arc)
|
|
|
|
}
|