DEV Community

Discussion on: Building RESTful Web APIs with Dart, Aqueduct, and PostgreSQL — Part 1

Collapse
 
vinceramces profile image
Vince Ramces Oliveros

August 12, 2018

As of Dart 2: I want to clarify things that needs to be changed.

router.route('/').listen((request) async {
  return new Response.ok('Hello world')
    ..contentType = ContentType.TEXT;
});

to

    router.route('/').linkFunction((router) async {
      return Response.ok("Hello World");
    });

Although I would like to point out many things, it's better to check out in their documentation because a lot of it are deprecated.

Have a great day!

Collapse
 
creativ_bracket profile image
Jermaine

Thanks Vince. Will do the rounds and make the edits soon.