tvl-depot/services/tazblog/blog/Main.hs
Vincent Ambo 11fcf62297 chore(tazblog): Replace BlogDB with stubs for DNS-based storage
Removes acid-state specific code and the former BlogDB module, in its
stead the new BlogStorage module contains stubs for the functions that
will be filled in with DNS-based storage.

This code is unformatted and will not currently serve a working blog.
2019-08-20 00:17:23 +01:00

28 lines
865 B
Haskell

-- | Main module for the blog's web server
module Main where
import Control.Applicative (pure, (<*>))
import Control.Exception (bracket)
import Data.Word (Word16)
import Locales (version)
import Network (HostName, PortID (..))
import Options
import Server
data MainOptions = MainOptions {
blogPort :: Int,
resourceDir :: String
}
instance Options MainOptions where
defineOptions = pure MainOptions
<*> simpleOption "blogPort" 8000
"Port to serve the blog on. Default is 8000."
<*> simpleOption "resourceDir" "/opt/tazblog/static"
"Resources folder location."
main :: IO()
main = do
putStrLn ("TazBlog " ++ version ++ " in Haskell starting")
runCommand $ \opts _ ->
runBlog (blogPort opts) (resourceDir opts)