From 63b2ff187e290d8eafd39a902af56a88c6ab53e9 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Tue, 18 Feb 2020 02:29:48 +0100 Subject: Initial commit --- app/Main.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/Main.hs (limited to 'app') 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 -- cgit v1.2.3