from Hacker News

Getting Started with Axum – Rust's Most Popular Web Framework

by dohman on 12/6/23, 3:44 PM with 25 comments

  • by jbandela1 on 12/6/23, 4:09 PM

    > Deployment with Rust backend programs in general can be less than ideal due to having to use Dockerfiles,

    Actually, in my experience, Rust is one of the best languages for ease of deployment (for much the same reason as Go). Rust/Cargo produces self-contained statically linked binaries. Rust/Cargo also has a real nice cross-compiling story. Often my deployment will be to build the binary and then basically scp the binary and supporting files (such as html/config) to the target. You don't really need Docker.

  • by Shish2k on 12/6/23, 4:29 PM

    Is it safe to expose to the internet[0]? I’m still looking for a Rust web framework that supports eg timeouts for idle connections so that it doesn’t crash and burn when it runs out of sockets after a few hours of serving production traffic (let alone being able to survive an intentional slowloris attack) :(

    [0] I’m ideally hoping for a framework which ticks the same boxes that Go’s `net/http` was ticking in 2016: https://blog.cloudflare.com/exposing-go-on-the-internet/

  • by Wonnk13 on 12/6/23, 4:12 PM

    This isn't trolling, it's my genuine ignorance- I thought Actix was the goto web framework for Rust? I don't do a whole lot of Rust and when I do it isn't http router type work so I'm out of the loop here.
  • by spacedimp on 12/7/23, 1:19 AM

    I love Axum as well that I also wrote a blog post teaching how to link it up with PostgreSQL and Tokio.

    https://spacedimp.com/blog/using-rust-axum-postgresql-and-to...

  • by boredumb on 12/6/23, 4:48 PM

    I've been using Tide with great success lately. Also - for my own projects I haven't used docker lately and just dump the binary with it's configs to the debian box with a systemd configured and so far it's been painless, ymmv.