diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Main.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/Main.hs b/app/Main.hs new file mode 100644 index 0000000..46bd5a3 --- /dev/null +++ b/app/Main.hs @@ -0,0 +1,19 @@ +module Main where + +import Lib +import Control.Exception +import Data.Aeson +import Data.Maybe +import qualified Data.ByteString.Lazy as BS + + +loadSettings :: IO Settings +loadSettings = do + contents <- try (BS.readFile "settings.json") :: IO (Either SomeException BS.ByteString) + return (either (const defaultSettings) (fromJust . decode) contents) + + +main :: IO () +main = do + settings <- loadSettings + runApp settings imgHostMain |