Routing is one of the most important parts of a web application. We already have our application deployed in http://localhost:9000
, but it's time to start defining names and addresses for our resources. First, we need to define what a resource is. Conceptually, a resource is every related data belonging to one single object or element. For example, a person resource can have fields such as name, address, birthday, and more. So, expanding this, a resource can be a list of persons too. We will talk deeply about how your resources should be named, organized, and called, but at this moment, you just need to know the basics. In a web application, every resource has its own address. Let's look at an example:
We have an address book with some contacts:
http://localhost:9000/
is the server URL, the base of all resources, the father path. Generally related to the home/welcome page, or first you define the user's view. The page has a button to see all our contacts.http://locahost...