Skip to content
Browse files

Merge branch 'master' of github.com:snapframework/snap-website

  • Loading branch information...
2 parents 0b92743 + d5bdfdc commit 8399e005cc651510efe82b366808c98aee53671e @mightybyte mightybyte committed
Showing with 16 additions and 16 deletions.
  1. +12 −12 snaplets/heist/templates/docs/tutorials/snap-api.md
  2. +4 −4 snaplets/heist/templates/faq.md
View
24 snaplets/heist/templates/docs/tutorials/snap-api.md
@@ -54,29 +54,29 @@ echoHandler = do
The behavior of this code can be summarized with the following rules:
-1. If the user requested the site's root page (http://mysite.com/), then
-return a page containing the string "hello world".
-2. If the user requested /foo, then return "bar".
-3. If the user requested /echo/xyz, then return "xyz".
-4. If the request URL begins with /static/, then look for files on disk
+1. If the user requested the site's root page (`http://mysite.com/`), then
+return a page containing the string `"hello world"`.
+2. If the user requested `/foo`, then return `"bar"`.
+3. If the user requested `/echo/xyz`, then return `"xyz"`.
+4. If the request URL begins with `/static/`, then look for files on disk
matching the rest of the path and serve them.
5. If none of these match, then Snap returns a 404 page.
Let's go over each of the Snap API functions used here.
-##### [`dir`](http://hackage.haskell.org/packages/archive/snap-core/0.8.0/doc/html/Snap-Core.html#v:dir)
+### [`dir`](http://hackage.haskell.org/packages/archive/snap-core/0.9.0/doc/html/Snap-Core.html#v:dir)
`dir` runs its action only if the request path starts with the specified
directory. You can combine successive dir calls to match more than one
subdirectory into the path.
-##### [`ifTop`](http://hackage.haskell.org/packages/archive/snap-core/0.8.0/doc/html/Snap-Core.html#v:ifTop)
+### [`ifTop`](http://hackage.haskell.org/packages/archive/snap-core/0.9.0/doc/html/Snap-Core.html#v:ifTop)
`ifTop` only executes its argument if the client requested the root URL. Use
this for your home page. It can also be combined with the `dir` function to
define your index handler for a certain URL directory.
-##### [`writeBS`](http://hackage.haskell.org/packages/archive/snap-core/0.8.0/doc/html/Snap-Core.html#v:writeBS)
+### [`writeBS`](http://hackage.haskell.org/packages/archive/snap-core/0.9.0/doc/html/Snap-Core.html#v:writeBS)
`writeBS` appends a strict ByteString to the response being constructed. Snap
also provides an analogous function `writeLBS` for lazy ByteStrings. You can
@@ -101,21 +101,21 @@ your site. For large sites, this could be quite noticeable. To remedy this,
Snap also provides you with the `route` function that routes requests based on the
request path in `O(log n)` time:
-##### [`route`](http://hackage.haskell.org/packages/archive/snap-core/0.8.0/doc/html/Snap-Core.html#v:route)
+### [`route`](http://hackage.haskell.org/packages/archive/snap-core/0.9.0/doc/html/Snap-Core.html#v:route)
`route` takes a list of (route, handler) tuples and succeeds returning the
result of the associated handler of the route that matches. If no route
-matches, then `route` fails and execution is passed on to `serveDirectory`.
+matches, then `route` fails and execution is passed on to `serveDirectory`.
In a real application, you will want to use `route` for almost everything.
We didn't do it that way in this example because we wanted to demonstrate
more of the API.
-##### [`getParam`](http://hackage.haskell.org/packages/archive/snap-core/0.8.0/doc/html/Snap-Core.html#v:getParam)
+### [`getParam`](http://hackage.haskell.org/packages/archive/snap-core/0.9.0/doc/html/Snap-Core.html#v:getParam)
`getParam` retrieves a GET or POST parameter from the request. In this
example, the `route` function binds a captured portion of the URL to the
-parameter `echoParam` so the associated handler can make easy use of it.
+parameter `echoParam` so the associated handler can make easy use of it.
`echoHandler` checks to see whether a parameter was passed and returns the
value or an error message if it didn't exist.
View
8 snaplets/heist/templates/faq.md
@@ -261,7 +261,7 @@ Note that in order to quit a running Snap app on Windows, you need to press `Ctr
### How can I help?
-##### Use Snap to build real websites.
+#### Use Snap to build real websites.
This is perhaps the best way to help. Let us know what issues you encounter
and work on fixing the ones you care about most. If you are unable to fix a
@@ -275,7 +275,7 @@ become more evident as we find code patterns common to real-world Snap
websites. Communicating real-world Snap development experiences to us is a
great way to contribute to this effort.
-##### Develop automated memory leak and performance regression testing.
+#### Develop automated memory leak and performance regression testing.
Currently our top priority is working out correctness and performance issues in
the server. We have a CI build server that automatically runs all our test
@@ -283,13 +283,13 @@ cases, but we don't have an automated system to test for performance and memory
leaks. This would be a very helpful addition.
-##### Improve test cases and code coverage.
+#### Improve test cases and code coverage.
While not an exotic task, expanding our test suite can contribute significantly
to the stability of the project.
-##### Improve documentation and tutorials.
+#### Improve documentation and tutorials.
It's easy for documentation to get out of date. We try to keep it up-to-date,
but we can always use more eyes to catch things that slip through the cracks.

0 comments on commit 8399e00

Please sign in to comment.
Something went wrong with that request. Please try again.