Commits

Luke Plant  committed 61f6e9d

Moved routes in BlogCgi.hs to Blog/Routes.hs

  • Participants
  • Parent commits daf5669

Comments (0)

Files changed (2)

File src/Blog/Routes.hs

 import qualified Blog.Category as C
 import qualified Blog.Post as P
 import qualified Blog.Settings as Settings
+import Web.Framework
+import Blog.Views
 
 -- TODO - a better way of generating this, something like Routes
 
 makePostUrl p = Settings.root_url ++ "posts/" ++ (P.slug p) ++ "/"
 makeCategoryUrl c = Settings.root_url ++ "categories/" ++ (C.slug c) ++ "/"
 
+routes = [ empty                       //-> mainIndex
+         , "debug/" <+/> stringParam   //-> debug
+         ]

File src/BlogCgi.hs

-import Blog.Views
+import Blog.Routes
 import Web.Framework
 
-views = [ empty                       //-> mainIndex
-        , "debug/" <+/> stringParam   //-> debug
-        ]
-
 main :: IO ()
-main = dispatchCGI views defaultDispatchOptions
+main = dispatchCGI routes defaultDispatchOptions