When defining routes and resources, we are essentially mapping URLs to possible states in our application. As shown in the first code snippet, the router's
map function takes a function as its only argument. Inside this function, we may define a resource using the corresponding method, which takes the following signature:
this.resource(resourceName, options, function);
The first argument specifies the name of the resource and coincidentally, the path to match the request URL. The next argument is optional and holds configurations that we may need to specify, as we shall see later. The last one is a function that is used to define the routes of that particular resource. For example, the first defined resource in the samples ...