📖 About This Demo

Static file serving implementation details

🎯 Purpose

This sample application demonstrates the static file serving capability implemented in DartStream's ds_shelf middleware package.

✨ Features Demonstrated

  • ✓ Serving HTML files from the public/ directory
  • ✓ Serving CSS stylesheets with correct MIME types
  • ✓ Serving JavaScript files with proper content types
  • ✓ Serving SVG images
  • ✓ Mixing static files with dynamic API routes
  • ✓ Default document support (index.html)

🔧 Implementation

The server uses the new addStaticRoute() method:

final server = DSShelfCore();
server.addStaticRoute('public');
                

🔗 Navigation