This is an experimental template that I use as a base for my personal projects. There are a lot of opinionated and probably controversial design choices that I've made here. I cannot recommend using this template for your own projects, especially if you're new to Rust.
- Internally caches asset files. JavaScript and CSS files are pre-compressed at
startup with
brotli
with a max compression level. - Compresses HTML fragments with
brotli
at a lower compression level viatower-compression
at runtime. - Sets Cache-Control headers for CSS, JS, WEBP, SVG, and WOFF2 by default.
- Uses
bun
via thebuild.rs
script to minify, hash, and bundle JS/TS/CSS. - Run with
cargo watch -x run
to automatically rebuild on asset / source changes.