Chapter 12. API Routing, Requests, and Responses

In the previous chapter, you explored the basic principles needed to manage and maintain a robust HTTP server using Shelf. In this chapter, you’ll be leveraging your Shelf implementation to expose a RESTful API that your ticket application can use.

Before you get to serving up responses, you need to implement the business logic that powers your ticket application. You’ll be implementing a simplified model–view–controller (MVC) pattern for which you’ll write some generic helper functionality to facilitate communication between your routing logic, your model, and your controllers.

Modeling Your Ticketing Domain

Back in Chapter 10, you built a class named MongoModel that implemented basic CRUD functionality ...

Get Write Web Apps with Dart: Develop and Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.