The What & Why of RESTful Routes

Krae Wind
2 min readFeb 18, 2021

This blog POST coincides with my second project for The Flatiron School. The project was to make a Sinatra web application that utilized an MVC (Model, View, Controller) architecture to create, read, update, and delete information. The data is able to persist on the server between visits to the web app. The project included aspects that utilized sessions to keep user information personal. The project deadline fell a couple days after my birthday, so I created an application to organize birthday cake recipes. The link to the repo for my project is HERE.

For the remainder of this POST, I will focus on RESTful routing.

First, what does REST mean? It stands for REpresentational State Transfer. Essentially, it is a ubiquitous architectural style meant to make it easier for computers to communicate with one another. REST is often used to standardize server-client relationships. A large benefit of using RESTful systems is the ability for the server and client to go about things independently and change over time without degrading the way they communicate with one another.

Another important feature of REST is its stateless nature. All this means is every HTTP request made between client and server is independent of other HTTP requests. In other words, each and every request knows nothing about the requests before and after. Each individual request contains all the information needed to do what the request is meant to accomplish.

RESTful routing, in particular, is nothing more than a set of common naming and organization patterns that act as the liaison between HTTP verbs and CRUD actions.

For example, in my Birthday Bonanza cake organizing app, the following mapping is present:

The seven actions are standard among most apps that can perform CRUD operations.

The main appeal for developers to use RESTful routes is they allow one to focus more energy on the code that matters rather than what to name and how to organize files. If RESTful routes did not exist, the internet would be a far less efficient and far more chaotic entity.

P.S.: I was unaware of it during the creation of my CLI app, however, I now know that every time a user queried the app for information, the app and the API were communicating using a REST architecture.

--

--