diff options
Diffstat (limited to 'website/sandbox/learnpianochords/src/server/Main.hs')
-rw-r--r-- | website/sandbox/learnpianochords/src/server/Main.hs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/website/sandbox/learnpianochords/src/server/Main.hs b/website/sandbox/learnpianochords/src/server/Main.hs index 36044d2585eb..a163c66cda07 100644 --- a/website/sandbox/learnpianochords/src/server/Main.hs +++ b/website/sandbox/learnpianochords/src/server/Main.hs @@ -2,7 +2,7 @@ module Main where -------------------------------------------------------------------------------- import RIO -import Prelude (putStrLn) +import Prelude (putStr, putStrLn) import qualified Types as T import qualified System.Envy as Envy @@ -18,8 +18,8 @@ getAppContext = do Left err -> pure $ Left err Right T.Env{..} -> pure $ Right T.Context { contextGoogleClientID = envGoogleClientID - , contextClientPort = 8000 - , contextServerPort = 3000 + , contextServerPort = envServerPort + , contextClientPort = envClientPort } main :: IO () @@ -27,4 +27,10 @@ main = do mContext <- getAppContext case mContext of Left err -> putStrLn err - Right ctx -> runRIO ctx App.run + Right ctx -> do + result <- runRIO ctx App.run + case result of + Left err -> do + putStr "Something went wrong when executing the application: " + putStrLn $ show err + Right _ -> putStrLn "The application successfully executed." |