happs-tutorial 0.6.1 → 0.6.2
raw patch · 3 files changed
+7/−14 lines, 3 files
Files
- happs-tutorial.cabal +1/−1
- src/Controller.hs +3/−4
- templates/cookies.st +3/−9
happs-tutorial.cabal view
@@ -1,5 +1,5 @@ Name: happs-tutorial-Version: 0.6.1+Version: 0.6.2 Synopsis: A HAppS Tutorial that is is own demo Description: A nice way to learn how to build web sites with HAppS
src/Controller.hs view
@@ -27,7 +27,6 @@ import HAppS.Helpers.DirBrowse import Misc import Data.ByteString.Internal -import HAppS.Server.CookieFixer import Text.StringTemplate.Helpers @@ -41,7 +40,7 @@ -- main controller controller :: STDirGroups String -> Bool -> Bool -> [ServerPartT IO Response]-controller tDirGroups dynamicTemplateReload allowStressTests = map cookieFixer $ +controller tDirGroups dynamicTemplateReload allowStressTests = -- staticfiles handler *has* to go first, or some content (eg images) will fail to load nondeterministically, -- eg http://localhost:5001/static/Html2/index.html (this loads ok when staticfiles handler goes first, -- but has the problem when staticfiles handler goes after tutorial handler)@@ -55,8 +54,8 @@ ++ [ myFavoriteAnimal ] ++ [ msgToSp "Quoth this server... 404." ] --- with diretoryGroups (lazy readFile), appkiller.sh causes crash-getTemplateGroups = directoryGroups2 "templates" -- directoryGroups "templates" +-- with diretoryGroupsOld (lazy readFile), appkiller.sh causes crash+getTemplateGroups = directoryGroups "templates" tutorial :: STDirGroups String -> Bool -> Bool -> [ServerPartT IO Response] tutorial tDirGroups' dynamicTemplateReload allowStressTests = [ ServerPartT $ \rq -> do
templates/cookies.st view
@@ -6,17 +6,11 @@ <p>Hopefully the underlying problems will be fixed in the next HAppS hackathon. -<p>Meanwhile, there is a workaround in the HAppSHelpers package on hackage, which is used by happstutorial.+<p>Meanwhile, there is a workaround in the HAppSHelpers package on hackage, which is used by happstutorial,+ and is built into smartserver. So cookies do work in happstutorial: I use google analytics to track visitors, along with normal HAppS session cookies.- And if you use happstutorial as your template for happs apps you should be fine.--<p>The cookie fix is just a couple lines of code in Controller.hs: --<p>import HAppS.Server.CookieFixer-<br>controller allowStressTests = map cookieFixer \$ ..... --+ And if you use happstutorial as a template for happs apps you should be fine. <p>Besides the cookies used by google analytics, which are obfuscated by javascript, happstutorial uses cookies to track session state -- the data that corresponds to the current user's session in