[fixed some typos Jeremy Shaw **20100616222233 Ignore-this: 4c07f8f4eacab6ba956d66690fd007a0 ] hunk ./HelloWorld.lhs 109 -

simpleHTTP processes each incoming request in it's own thread. It will parse the Request call your ServerPartT handler, and then return the Response to the client. When developing your server part, it is natural to think about things as if you are writing a program which processes a single Request, generates a Response, and exits. However it is important when doing I/O, such as writing files to disk, or talking to a ''database'' to remember that there may be other threads running simultaneously.

+

simpleHTTP processes each incoming request in it's own thread. It will parse the Request, call your ServerPartT handler, and then return the Response to the client. When developing your server part, it is natural to think about things as if you are writing a program which processes a single Request, generates a Response, and exits. However it is important when doing I/O, such as writing files to disk, or talking to a database to remember that there may be other threads running simultaneously.

hunk ./HelloWorld.lhs 119 -

ok is one of several combinators which can be used to set the HTTP response code. In this case, it will set the response code to 200 OK. Happstack.Server.SimpleHTTP contains similar functions for the common HTTP respond codes including, notFound, seeOther, badRequest and more.

+

ok is one of several combinators which can be used to set the HTTP response code. In this case, it will set the response code to 200 OK. Happstack.Server.SimpleHTTP contains similar functions for the common HTTP response codes including, notFound, seeOther, badRequest and more.