In this recipe, we'll see how to make a URL of the http://yourserver/path1/path2 form accessible to users. This can either be a web page or a path returning arbitrary data to be consumed by other programs. In the latter case, you would usually use the JSON format to consume parameters and to offer your data.
Making a path accessible from the network
Getting ready
We'll make use of the library.book model of Chapter 5, Application Models, so in case you haven't done so yet, grab its code to be able to follow the examples.
We want to allow any user to query the full list of books. Furthermore, we want to provide the same information to programs via a JSON request.