A bunch of special files served from the root path can do fancy stuff like:
- provide icons (
- control bots and stuff (
- describe the website structure (
This change makes adding these kinds of files simple: the whole
is served at the root, so they just go inside that folder and things Just Work.
Most static files are served from sub-folders anyway, and now those paths are
less of a mouthful.
It's basically nginx's
The obvious alternative would be to configure routes for each special static
file that we want to serve from the route, which would just serve that file.
This would have the advantage not touching the filesystem for every request to
see if there's a static file we can serve.
I'm proposing it this way instead because
- OSes are smart, so fs checks on every request are probably cheap enough?
- Caching should probably prevent rust from serving most requests anyway
- Configuring routes and handlers (or a macro or something) seems painful and
tedious and higher-barrier to getting stuff done.