Added example
diff --git a/example/example_server.dart b/example/example_server.dart
new file mode 100644
index 0000000..948c397
--- /dev/null
+++ b/example/example_server.dart
@@ -0,0 +1,19 @@
+library shelf_static.example;
+
+import 'dart:io';
+import 'package:shelf/shelf.dart' as shelf;
+import 'package:shelf/shelf_io.dart' as io;
+import 'package:shelf_static/shelf_static.dart';
+
+void main() {
+ if (!FileSystemEntity.isFileSync('example/example_server.dart')) {
+ throw new StateError('Server expects to be started the '
+ 'root of the project.');
+ }
+ var handler = const shelf.Pipeline().addMiddleware(shelf.logRequests())
+ .addHandler(getHandler('example/files'));
+
+ io.serve(handler, 'localhost', 8080).then((server) {
+ print('Serving at http://${server.address.host}:${server.port}');
+ });
+}
diff --git a/example/files/index.html b/example/files/index.html
index ab4df2c..941f5fe 100644
--- a/example/files/index.html
+++ b/example/files/index.html
@@ -3,8 +3,9 @@
<html>
<head>
<meta charset="utf-8">
+ <title>shelf_static</title>
</head>
-
<body>
+ <h1>Hello, shelf_static!</h1>
</body>
</html>