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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.