Adding a REST API
In the previous chapter, we learned how to build a Todo MVC web app using Genie. This approach uses a JS web frontend for our users. But what if we want to make our data, which is stored in a database, available to other kinds of graphical frontends, such as a mobile app or a desktop application? We don’t want to rewrite everything from scratch for each new frontend. Besides, other companies may want to write these frontends to our data.
In this chapter, we’ll add a REST API to our existing app by organizing our code so as to allow other applications and software to access and interact with our data. Here are the topics we are going to discuss in this chapter:
- Extending a web app with a REST API
- Writing tests for a REST API
- Documenting our API with the Swagger UI