From 6f62d9c48c19b61470acbb6770ed1a25f7284a56 Mon Sep 17 00:00:00 2001 From: Mighty Byte Date: Tue, 7 Apr 2009 08:06:53 -0400 Subject: [PATCH] Created rootRedirect function. --- demo/Blog-NoAuth/Main.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo/Blog-NoAuth/Main.hs b/demo/Blog-NoAuth/Main.hs index aec100d..2b60faf 100644 --- a/demo/Blog-NoAuth/Main.hs +++ b/demo/Blog-NoAuth/Main.hs @@ -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"] "." @@ -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