OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library shelf.typedef; | |
6 | |
7 import 'request.dart'; | 5 import 'request.dart'; |
8 | 6 |
9 /// The signature of a function which handles a [Request]. | 7 /// The signature of a function which handles a [Request]. |
10 /// | 8 /// |
11 /// A [Handler] may receive a request directly from an HTTP server or it | 9 /// A [Handler] may receive a request directly from an HTTP server or it |
12 /// may be composed as part of a larger application. | 10 /// may be composed as part of a larger application. |
13 /// | 11 /// |
14 /// Should return [Response] or [Future<Response>]. | 12 /// Should return [Response] or [Future<Response>]. |
15 //TODO(kevmoo): provide a more detailed explanation. | 13 //TODO(kevmoo): provide a more detailed explanation. |
16 typedef Handler(Request request); | 14 typedef Handler(Request request); |
OLD | NEW |