Merge pull request #241 from axellebot/doc

Edit documentation
This commit is contained in:
Tobe Osakwe 2019-08-16 08:45:37 -04:00 committed by GitHub
commit 185b5d6598
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View file

@ -124,7 +124,15 @@ class Controller {
}; };
} }
/// Used to add additional routes to the router from within a [Controller]. /// Used to add additional routes or middlewares to the router from within
/// a [Controller].
///
/// ```dart
/// @override
/// FutureOr<void> configureRoutes(Routable routable) {
/// routable.all('*', myMiddleware);
/// }
/// ```
FutureOr<void> configureRoutes(Routable routable) {} FutureOr<void> configureRoutes(Routable routable) {}
/// Finds the [Expose] declaration for this class. /// Finds the [Expose] declaration for this class.

View file

@ -21,7 +21,20 @@ class Hooks {
const Hooks({this.before = const [], this.after = const []}); const Hooks({this.before = const [], this.after = const []});
} }
/// Exposes a [Controller] to the Internet. /// Exposes a [Controller] or a [Controller] method to the Internet.
///
/// ```dart
/// @Expose('/elements')
/// class ElementController extends Controller {
///
/// @Expose('')
/// getList(){}
///
/// @Expose('/:elementId')
/// getElement(int elementId){}
///
/// }
/// ```
class Expose { class Expose {
final String method; final String method;
final String path; final String path;