Valerioageno / ssr-rs

Server side rendering on rust servers using the v8 engine for parse and evaluate the javascript code.

Home Page:https://docs.rs/ssr_rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

example `tide` bug

www159 opened this issue · comments

commented

thanks for amazing work.
however, there are errors when runing example tide
the src:

...
async fn main() -> tide::Result<()> {
    let mut app = tide::new();
    app.at("/styles/*").serve_dir("client/dist/ssr/styles/")?;
    app.at("/images/*").serve_dir("client/dist/ssr/images/")?;
    app.at("/scripts/*").serve_dir("client/dist/client/")?;
    app.at("/*").get(return_html);
    app.listen("127.0.0.1:8080").await?;
    Ok(())
}
...

It should be:

...
async fn main() -> tide::Result<()> {
    let mut app = tide::new();
    app.at("/styles/").serve_dir("client/dist/ssr/styles/")?;
    app.at("/images/").serve_dir("client/dist/ssr/images/")?;
    app.at("/scripts/").serve_dir("client/dist/client/")?;
    app.at("/").get(return_html);
    app.listen("127.0.0.1:8080").await?;
    Ok(())
}
...

Hey @www159, sorry for the very late reply. I've just release a new crate version. Thanks for the suggestion. Updated.