Skip to content

Instantly share code, notes, and snippets.

@graphicbeacon
Created June 15, 2018 16:03
Show Gist options
  • Save graphicbeacon/7e4b3f1862cd56a4a719c38debb38ffb to your computer and use it in GitHub Desktop.
Save graphicbeacon/7e4b3f1862cd56a4a719c38debb38ffb to your computer and use it in GitHub Desktop.
Sample code for "Building RESTful Web APIs with Dart, Aqueduct and PostgreSQL (Bonus content)" post on Medium (6)
// ..
class BooksController extends HTTPController {
@httpGet
Future<Response> getAllBooks() async {
var query = new Query<Book>()..join(set: (book) => book.authors);
return new Response.ok(await query.fetch());
}
// ..
// ..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment