diff --git a/nvd-server/Cargo.toml b/nvd-server/Cargo.toml index f979fb8..2432ba7 100644 --- a/nvd-server/Cargo.toml +++ b/nvd-server/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] actix-web = { version = "4.4.0", features = ["openssl"] } +actix-files = "0.6.2" actix-cors = "0.6.4" diesel = { version = "2.1.4", features = ["r2d2", "mysql", "chrono", "uuid", "serde_json"] } serde = { version = "1", features = ["derive"] } diff --git a/nvd-server/nvd-er.mwb b/nvd-server/nvd-er.mwb index 26294b3..38af0f2 100644 Binary files a/nvd-server/nvd-er.mwb and b/nvd-server/nvd-er.mwb differ diff --git a/nvd-server/src/main.rs b/nvd-server/src/main.rs index eafdfa5..6f5c083 100644 --- a/nvd-server/src/main.rs +++ b/nvd-server/src/main.rs @@ -18,6 +18,11 @@ async fn main() -> std::io::Result<()> { .wrap(middleware::Logger::default()) .app_data(web::Data::new(connection_pool.clone())) .service(web::scope("/api").configure(api_route)) + .service( + actix_files::Files::new("/", "nvd-server/dist") + .show_files_listing() + .index_file("index.html"), + ) }) .bind(("127.0.0.1", 8888))? .run() diff --git a/nvd-yew/src/lib.rs b/nvd-yew/src/lib.rs index 899e860..d2c7910 100644 --- a/nvd-yew/src/lib.rs +++ b/nvd-yew/src/lib.rs @@ -21,10 +21,10 @@ impl Component for App { fn view(&self, _ctx: &Context) -> Html { html! {
- +
} } diff --git a/nvd-yew/src/routes/mod.rs b/nvd-yew/src/routes/mod.rs index 0807cd4..e802f59 100644 --- a/nvd-yew/src/routes/mod.rs +++ b/nvd-yew/src/routes/mod.rs @@ -1,12 +1,12 @@ mod cve; mod cve_list; -mod cvss; +// mod cvss; mod home; mod page_not_found; use crate::modules::cve::CveInfoList; use cve::CVEDetails; -use cvss::Cvss; +// use cvss::Cvss; use home::Home; use page_not_found::PageNotFound; use yew::prelude::*; @@ -15,12 +15,10 @@ use yew_router::prelude::*; pub enum Route { #[at("/cve/:id")] Cve { id: String }, - #[at("/cve")] + #[at("/cve/")] CveList, #[at("/")] Home, - #[at("/cvss")] - Cvss, #[not_found] #[at("/404")] NotFound, @@ -38,9 +36,9 @@ impl Route { Route::Cve { id } => { html! {} } - Route::Cvss => { - html! { } - } + // Route::Cvss => { + // html! { } + // } Route::NotFound => { html! { } }