diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-02-18 02:29:48 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-02-18 02:29:48 +0100 |
commit | 63b2ff187e290d8eafd39a902af56a88c6ab53e9 (patch) | |
tree | f85e5df75b46c799c511c953bc93f995f4bf4042 /app | |
download | simghost-63b2ff187e290d8eafd39a902af56a88c6ab53e9.tar.gz simghost-63b2ff187e290d8eafd39a902af56a88c6ab53e9.tar.bz2 simghost-63b2ff187e290d8eafd39a902af56a88c6ab53e9.zip |
Initial commit
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 |