When I enter example.com/files, I expect I could get a file explorer page, but actually nothing. when I delete handle /files/* { and visit example.com, everything works fine
You used a matcher of /files/* which does not match /files. You would need to use a /files* matcher instead to match that path.
The handle_path directive strips the given matcher from the request path before continuing. handle does not.
So for example with a request like /files/foo.txt, when file_server assembles the path, it looks for files at ./asset/files/foo.txt for example, instead of /asset/foo.txt, because /files doesn’t get removed by handle.
so visit example.com/files actually visit ./asset/files directory (so I need to create files dir inside asset dir, it works, but it also means I can only visit file inside ./asset/files, there is no way to visit ./asset/foo.txt unless I change handle to handle_path )
visit example.com doesn’t get ./asset/ because it only handle files*