OLD | NEW |
1 ## Web Server Middleware for Dart | 1 ## Web Server Middleware for Dart |
2 | 2 |
3 [![Build Status](https://travis-ci.org/dart-lang/shelf.svg?branch=master)](https
://travis-ci.org/dart-lang/shelf) | 3 [![Build Status](https://travis-ci.org/dart-lang/shelf.svg?branch=master)](https
://travis-ci.org/dart-lang/shelf) |
4 [![Coverage Status](https://coveralls.io/repos/dart-lang/shelf/badge.svg?branch=
master)](https://coveralls.io/r/dart-lang/shelf) | 4 [![Coverage Status](https://coveralls.io/repos/dart-lang/shelf/badge.svg?branch=
master)](https://coveralls.io/r/dart-lang/shelf) |
5 | 5 |
6 ## Introduction | 6 ## Introduction |
7 | 7 |
8 **Shelf** makes it easy to create and compose **web servers** and **parts of web | 8 **Shelf** makes it easy to create and compose **web servers** and **parts of web |
9 servers**. How? | 9 servers**. How? |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 /// [runZoned] and pass them to [onError]. | 141 /// [runZoned] and pass them to [onError]. |
142 catchTopLevelErrors(callback(), void onError(error, StackTrace stackTrace)) { | 142 catchTopLevelErrors(callback(), void onError(error, StackTrace stackTrace)) { |
143 if (Zone.current.inSameErrorZone(Zone.ROOT)) { | 143 if (Zone.current.inSameErrorZone(Zone.ROOT)) { |
144 return runZoned(callback, onError: onError); | 144 return runZoned(callback, onError: onError); |
145 } else { | 145 } else { |
146 return callback(); | 146 return callback(); |
147 } | 147 } |
148 } | 148 } |
149 ``` | 149 ``` |
150 | 150 |
| 151 An adapter that knows its own URL should provide an implementation of the |
| 152 [`Server`][server] interface. |
| 153 |
| 154 [server]: http://www.dartdocs.org/documentation/shelf/latest/index.html#shelf/sh
elf@id_Server |
| 155 |
151 ## Inspiration | 156 ## Inspiration |
152 | 157 |
153 * [Connect](http://www.senchalabs.org/connect/) for NodeJS. | 158 * [Connect](http://www.senchalabs.org/connect/) for NodeJS. |
154 * Read [this great write-up](http://howtonode.org/connect-it) to understand | 159 * Read [this great write-up](http://howtonode.org/connect-it) to understand |
155 the overall philosophy of all of these models. | 160 the overall philosophy of all of these models. |
156 * [Rack](http://rack.github.io/) for Ruby. | 161 * [Rack](http://rack.github.io/) for Ruby. |
157 * [WSGI](http://legacy.python.org/dev/peps/pep-3333/) for Python. | 162 * [WSGI](http://legacy.python.org/dev/peps/pep-3333/) for Python. |
OLD | NEW |