6 ms·
My backend for a simple web application I'm working on is entirely in Rust. Highlights: - axum: web application framework - https://github.com/tokio-rs/axum ht
by fprotthetarball 2y ago
My backend for a simple web application I'm working on is entirely in Rust. Highlights:
- axum: web application framework - https://github.com/tokio-rs/axum https://github.com/tokio-rs/axum
- axum-htmx: axum extractors, responders, guards for htmx - https://github.com/robertwayne/axum-htmx https://github.com/robertwayne/axum-htmx
- rusqlite: SQLite bindings - https://github.com/rusqlite/rusqlite https://github.com/rusqlite/rusqlite
- maud: HTML templating as a macro - https://maud.lambda.xyz https://maud.lambda.xyz
The way maud lets you compose markup works very nicely with htmx. The HX-Request header lets you know if the request is coming from htmx or if it is a regular request. You either call the top-level function if it's a regular request to get the entire page rendered, or call a subset of functions to get the appropriate partial rendered if it's an htmx request.
It's also nice to easily have tests for the rendered pages. My unit tests cover verification of the rendered HTML, too.
- brunoqc 2y agoDo you use something like cargo-watch for "hot reload"?
- fprotthetarball 2y agoNo, I just stop and restart when I feel like I'm in a good spot. Nothing fancy.