Fix css hot reload
This commit is contained in:
parent
315474b708
commit
cf65d5b8e9
3 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,12 @@ cfg_if! {
|
|||
use leptos_actix::{generate_route_list, LeptosRoutes};
|
||||
use simple_logger::SimpleLogger;
|
||||
|
||||
#[get("/style.css")]
|
||||
async fn css() -> impl Responder {
|
||||
actix_files::NamedFile::open_async("./style/output.css").await
|
||||
}
|
||||
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
// Configure logger
|
||||
|
@ -38,6 +44,7 @@ cfg_if! {
|
|||
.app_data(web::Data::clone(&data)) // Must panic if data can't be loaded
|
||||
.route("/api/{tail:.*}", leptos_actix::handle_server_fns())
|
||||
.leptos_routes(leptos_options.to_owned(), routes.to_owned(), || view! { <App/> })
|
||||
.service(css)
|
||||
.service(Files::new("/", site_root))
|
||||
.wrap(middleware::Compress::default())
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue