Skip to content

Add static file serving support #2

Description

@abdullaBest

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions