1414// limitations under the License.
1515
1616@TestOn ('vm' )
17+ library ;
18+
1719import 'dart:convert' ;
1820import 'dart:io' ;
1921
@@ -291,7 +293,7 @@ void main() {
291293
292294 final app = Router ()
293295 ..all ('/hello' , (RequestContext context) => Response (body: 'hello-world' ))
294- ..mount ('/api/' , api)
296+ ..mount ('/api/' , api.call )
295297 ..all (
296298 '/<_|[^]*>' ,
297299 (RequestContext context) => Response (body: 'catch-all-handler' ),
@@ -339,7 +341,7 @@ void main() {
339341 final app = Router ()
340342 ..mount (
341343 '/api/' ,
342- const Pipeline ().addMiddleware (middleware).addHandler (api),
344+ const Pipeline ().addMiddleware (middleware).addHandler (api.call ),
343345 );
344346
345347 server.mount ((request) async {
@@ -370,7 +372,7 @@ void main() {
370372 ..all ('/hello' , (RequestContext context) {
371373 return Response (body: 'hello-world' );
372374 })
373- ..mount ('/api' , api)
375+ ..mount ('/api' , api.call )
374376 ..all ('/<_|[^]*>' , (RequestContext context) {
375377 return Response (body: 'catch-all-handler' );
376378 });
@@ -491,7 +493,7 @@ void main() {
491493 return Response (body: '$user to $other : $action ' );
492494 });
493495
494- return router;
496+ return router.call ;
495497 }
496498
497499 // Routes for a specific <user>.
@@ -508,7 +510,7 @@ void main() {
508510 ..get ('/' , (RequestContext context) {
509511 return Response (body: '$user root' );
510512 });
511- return router;
513+ return router.call ;
512514 }
513515
514516 final app = Router ()
0 commit comments