News for hackers. Stuff that matters.
Re:Choosing a Rust web framework by continuations on Sunday July 05, 2020 @01:34PM (#23740353)
> 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?

Re:Choosing a Rust web framework by Tyr42 on Sunday July 05, 2020 @01:57PM (#23740514)
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
    }
Re:Choosing a Rust web framework by stu2b50 on Sunday July 05, 2020 @02:05PM (#23740581)
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.
Re:Choosing a Rust web framework by LukeMathWalker on Sunday July 05, 2020 @01:38PM (#23740379)
Unfortunately not my area of expertise, so I don't have particularly interesting or insightful opinions to give on the matter.
Re:Choosing a Rust web framework by dgb23 on Sunday July 05, 2020 @01:51PM (#23740483)
Rocket has the option for responding with html templates.
Re:Choosing a Rust web framework by tiborsaas on Sunday July 05, 2020 @01:42PM (#23740405)
I would just look for a html templating crate.