The server should support serving static files from a configured directory.
Right now it can respond to requests, but without static file support it is not very useful for practical web use cases such as serving HTML, CSS, JavaScript, images, and fonts.
Expected behavior:
- map
/ to public/index.html;
- map paths like
/style.css or /app.js to files inside the configured root;
- return
404 for missing files;
- return
403 for forbidden paths;
- prevent path traversal outside the configured root;
- set basic MIME types;
- optionally support
HEAD requests.
This would make the project more usable as an actual lightweight web server instead of only a hardcoded response demo.
The server should support serving static files from a configured directory.
Right now it can respond to requests, but without static file support it is not very useful for practical web use cases such as serving HTML, CSS, JavaScript, images, and fonts.
Expected behavior:
/topublic/index.html;/style.cssor/app.jsto files inside the configured root;404for missing files;403for forbidden paths;HEADrequests.This would make the project more usable as an actual lightweight web server instead of only a hardcoded response demo.