Warning
This post was published 95 days ago. The infomation described in this article may have changed.
If it is just a modification of the elements and css in the html, it must be recompiled is there any way to solve this problem? @freedit
There is another way:
just add
let mut router_static = Router::new() .route("/static/style.css", get(style)) .nest_service("/static/avatars", ServeDir::new(&CONFIG.avatars_path)) .nest_service("/static/inn_icons", ServeDir::new(&CONFIG.inn_icons_path)) .nest_service("/static/upload", ServeDir::new(&CONFIG.upload_path)) .nest_service("/css", ServeDir::new("./static/css"));
And then you will get /css/main.css
in static css folder.