Basic Request Handling in Happstack

One of the most basic functions of a web framework is to give you a way of controlling what happens when a web browser makes an http request.

Let's look at some simple examples.

  1. Read the source code of the simpleHandlers function in ControllerBasic.hs to see how urls are handled in Happstack. The comments contain the bulk of the information in this chapter.
  2. Follow the urls below by clicking on them. Match what happens when you click on a link with the code in ControllerBasic.hs.

The static file serving example above hints at the templating system used by this tutorial to put together web pages behind the scenes.

We learn about ways to conveniently include HTML next.