From e2b5d4f135b3277739d35f298f88026524316178 Mon Sep 17 00:00:00 2001 From: Axel LE BOT Date: Sat, 27 Jul 2019 11:46:03 +0200 Subject: [PATCH 1/2] Edit Controller.configureRoutes doc --- lib/src/core/controller.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/core/controller.dart b/lib/src/core/controller.dart index b9dd28dc..36573f4c 100644 --- a/lib/src/core/controller.dart +++ b/lib/src/core/controller.dart @@ -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 configureRoutes(Routable routable) { + /// routable.all('*', myMiddleware); + /// } + /// ``` FutureOr configureRoutes(Routable routable) {} /// Finds the [Expose] declaration for this class. From b58172ba60ee8ae26a220cf7c2399c2d2f5eb281 Mon Sep 17 00:00:00 2001 From: Axel LE BOT Date: Sat, 27 Jul 2019 12:07:57 +0200 Subject: [PATCH 2/2] Edit Expose doc --- lib/src/core/metadata.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/src/core/metadata.dart b/lib/src/core/metadata.dart index 877073ff..b0d245a2 100644 --- a/lib/src/core/metadata.dart +++ b/lib/src/core/metadata.dart @@ -21,7 +21,20 @@ class Hooks { 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 { final String method; final String path;