Clone this repo:
  1. af161a3 Fix test of contentLength by Kevin Moore · 8 weeks ago master
  2. b0d3a96 Create .test_config by William Hesse · 7 months ago
  3. 7337909 Added option to allow for mimetype lookup via magic numbers by Kevin Moore · 9 months ago 0.2.4
  4. 366d49a Some cleanup by Matthew Barbour · 9 months ago
  5. 82e6a33 Documented useHeaderBytesForContentType by Matthew Barbour · 9 months ago

shelf_static is a Handler for the Dart shelf package.

Build Status Coverage Status

Example

import 'package:shelf/shelf_io.dart' as io;
import 'package:shelf_static/shelf_static.dart';

void main() {
  var handler = createStaticHandler('example/files', 
      defaultDocument: 'index.html');

  io.serve(handler, 'localhost', 8080);
}