8 ms·
Can you embed the html files into the binary using Rust like you can with Go? One of the coolest features of Go is the embed package. You can build, and bundle
by impulser_ 3y ago
Can you embed the html files into the binary using Rust like you can with Go?
One of the coolest features of Go is the embed package. You can build, and bundle a React, Vue, SvelteKit, Astro or w.e framework directly into your binary and have it serve with your API. Makes deploying very easy, just ship the single file binary.
- notaboredguy 3y agoYes, check https://doc.rust-lang.org/std/macro.include_str.html https://doc.rust-lang.org/std/macro.include_str.html
- Thaxll 3y agoIt's a utf8 string though, Go gives you a reader which is any type of data.