Getting there
This commit is contained in:
parent
1b37e0a2a3
commit
b0b804f409
3 changed files with 3 additions and 3 deletions
|
@ -189,7 +189,7 @@ class Router extends Extensible {
|
||||||
/// For example, if the [Router] has a middleware 'y', and the `namespace`
|
/// For example, if the [Router] has a middleware 'y', and the `namespace`
|
||||||
/// is 'x', then that middleware will be available as 'x.y' in the main router.
|
/// is 'x', then that middleware will be available as 'x.y' in the main router.
|
||||||
/// These namespaces can be nested.
|
/// These namespaces can be nested.
|
||||||
void use(Pattern path, Router router,
|
void mount(Pattern path, Router router,
|
||||||
{bool hooked: true, String namespace: null}) {
|
{bool hooked: true, String namespace: null}) {
|
||||||
// Let's copy middleware, heeding the optional middleware namespace.
|
// Let's copy middleware, heeding the optional middleware namespace.
|
||||||
String middlewarePrefix = namespace != null ? "$namespace." : "";
|
String middlewarePrefix = namespace != null ? "$namespace." : "";
|
||||||
|
|
|
@ -6,7 +6,7 @@ main() {
|
||||||
final fooById = foo.child(':id((?!bar)[0-9]+)', handlers: ['bar']);
|
final fooById = foo.child(':id((?!bar)[0-9]+)', handlers: ['bar']);
|
||||||
final bar = fooById.child('bar');
|
final bar = fooById.child('bar');
|
||||||
final baz = bar.child('//////baz//////', handlers: ['hello', 'world']);
|
final baz = bar.child('//////baz//////', handlers: ['hello', 'world']);
|
||||||
final bazById = baz.child(':bazId([A-Za-z]+)');
|
final bazById = baz.child(':bazId([A-Za-z]+)?');
|
||||||
new Router(root: foo).dumpTree();
|
new Router(root: foo).dumpTree();
|
||||||
|
|
||||||
test('matching', () {
|
test('matching', () {
|
||||||
|
|
|
@ -17,7 +17,7 @@ main() {
|
||||||
c = router.post('c', 'Hello nested');
|
c = router.post('c', 'Hello nested');
|
||||||
});
|
});
|
||||||
|
|
||||||
parent.use('child', child);
|
parent.mount('child', child);
|
||||||
parent.dumpTree(header: tattleAll([parent, child, a]));
|
parent.dumpTree(header: tattleAll([parent, child, a]));
|
||||||
|
|
||||||
group('no params', () {
|
group('no params', () {
|
||||||
|
|
Loading…
Reference in a new issue