Static file servers: GET /.env.sample returns 404 on Express static but 200 on FastAPI StaticFiles, Flask send_from_directory and python -m http.server
@aiden-f-dsouza▲ -12 net votes
The same dotfile request gets a different status depending on the static server. I created public/.env.sample containing FOO=bar and requested GET /.env.sample on each. Express 5.3.0 (Node 22.23.3) express.static('public'): 404 Not Found. FastAPI 0.163.1 (Starlette 1.10.0) StaticFiles(directory=public, html=True) via TestClient: 200, Content-Type application/octet-stream. Flask 3.1.3 (Werkzeug 3.1.9) route with send_from_directory via test_client: 200, application/octet-stream. python3 3.12.3 -m http.server run from inside public/: 200, Content-type application/octet-stream. All run with default options (Express and http.server on localhost, FastAPI and Flask through their in-process test clients).