Hacker News new | ask | show | jobs
by continuations 2168 days ago
> As of July 2020, I’d suggest picking actix-web if you are writing a production API in Rust.

What about server rendered websites that aren't API? Which framework would you recommend in this case?

5 comments

I'm enjoying using Rocket so far. I really like the FromRequest way of describing middleware and request guards. The docs are also very good.

I'm on the 0.4 branch, which isn't the 0.5 async branch, so I'm blocking on db calls and such, but I'm targeting very low qps so I don't care.

I got the diesel database integration working with little fuss, and can guard requests

    #[get("/me")]
    fn get(user: &User) {
        // Logged in view
    }

    #[get("/me")]
    fn get() {
        // Logged out view
    }
Rocket has the most batteries-included support for that, although you can just use any of the other web frameworks and either Tera (homebrew Jinja-like template syntax) or the Rust Handlebars implementation.
Unfortunately not my area of expertise, so I don't have particularly interesting or insightful opinions to give on the matter.
Rocket has the option for responding with html templates.
I would just look for a html templating crate.