Clone this repo:
  1. 2295fea Add a function to serve a single file (#22) by Natalie Weizenbaum · 5 days ago master 0.2.6
  2. 70112b6 Cleanup (#20) by Kevin Moore · 5 months ago 0.2.5
  3. b6e30c8 Merge https://github.com/dart-lang/shelf_static/pull/19 by Kevin Moore · 5 months ago
  4. dd42ca9 Tweak changelog by Kevin Moore · 5 months ago
  5. 7caaf34 Bumped version number to 0.2.5 by Matthew Barbour · 6 months ago

shelf_static is a Handler for the Dart shelf package.

Build 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);
}