Closed CorvusPrudens closed 5 months ago
Sorry for the delayed response -- Looks good, and thanks!
Oh no! My bad -- I forgot to mention there's actually a problem with this implementation. There seems to be some interaction between the headers that are let through to the directory server causing 404s. I have a patch open at #41.
This PR adjusts the file-serving code to serve compressed assets, if present. If static assets are not compressed, the behavior should remain unchanged.
Since the
--precompress
option incargo-leptos
is such a great and convenient feature, I thought it would be nice to make it easy to get working with this starter template!One potential downside of this addition is that subsequent recompiles without
--precompress
may not be served correctly, as the file server will prefer the compressed files. I deemed this acceptable since files are not compressed by default.Sorry for the messy diff! It looks like the file wasn't previously run through
rustfmt
. I should also note that I made an opinionated change to the error message, but I thought it would make an actual panic a little more clear.