1. new in this version
  2. build a web 2.0 app in happstack
  3. why happstack is cool
  4. getting started with happstack
  5. prerequisites
  6. cabal install me
  7. first shot at happstack
  8. url handling
  9. basic HTML inclusion
  10. templates
  11. stringtemplate basics
  12. debugging
  13. form data: get and post
  14. form data: file uploads
  15. cookies
  16. introduction to macid
  17. first steps with macid
  18. scaling with multimaster
  19. using macid safely
  20. macid dummy data
  21. changing the data model
  22. macid stress test
  23. limitations of macid
  24. foreign characters
  25. IxSets
  26. cron jobs
  27. thanks
  28. appendix (floundering in ghci)

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.