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)

Populate your job board with dummy data

Assumng you are following along with the tutorial and running locally, you now have a job board with one user ("testuser") and no jobs, unless you took the time to create additional test data manually.

When quickly hacking together a data-driven website, populating your app with dummy data is a chore you want to avoid wasting time on, so let's see how to do that.

Firstly, restart Happstack in a pristine state by either deleting or backing up your _local data directory as described earler.

Now, click this link.

If everything worked right, you should now have two users and a couple hundred jobs worth of test data displaying in your jobs site.

What have we done here?

We've used the code found in ControllerStressTests.hs to take action on the tutorial application state, which is to be found in AppState1.hs. Now that you've had a basic introduction of using Happstack.State, I recommend looking through these files to get a better feel for more complicated examples.

Now we need to discuss what to do when you need to change your data types.