Skip to content

Commit

Permalink
Created rootRedirect function.
Browse files Browse the repository at this point in the history
  • Loading branch information
mightybyte committed Apr 7, 2009
1 parent 8c3e5a8 commit 6f62d9c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion demo/Blog-NoAuth/Main.hs
Expand Up @@ -40,6 +40,8 @@ getPosts = asks postDB

$(mkMethods ''BlogState ['addPost, 'getPosts])

rootRedirect = seeOther "/" (toResponse "")

impl = msum
[ dir "new" $
msum [methodSP GET $ fileServe ["new_post.html"] "."
Expand All @@ -51,7 +53,7 @@ addPostHandler = do
(Just title) <- getDataFn $ look "title"
(Just body) <- getDataFn $ look "body"
update $ AddPost (Post title body)
seeOther "/" (toResponse "")
rootRedirect

viewPostsHandler = do
posts <- query $ GetPosts
Expand Down

0 comments on commit 6f62d9c

Please sign in to comment.