Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cdepillabout committed Jun 5, 2024
1 parent d2ac16f commit 8f3bd03
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cqg-cms-api-client/app/cqg-cms-example/Main.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@

module Main where
module Main (main) where

import Lib

import Wuss
import Data.Maybe (fromMaybe)
import Lib ()
import Network.WebSockets (Connection)
import System.Environment (lookupEnv)
import Text.Read (readMaybe)
import Wuss (runSecureClient)


-- | Get a 'String' environment variable.
Expand Down Expand Up @@ -31,7 +34,7 @@ getFromEnv envVar defVal = do
case maybeRes of
Nothing -> pure defVal
Just strRes -> do
case readMay strRes of
case readMaybe strRes of
Nothing ->
error $ "Can't read environment variable " <> envVar <> " value: " <> strRes
Just res -> pure res
Expand All @@ -44,5 +47,5 @@ main = do
path <- getEnv "CQG_WEBSOCKETS_PATH" "/"
runSecureClient hostname port path app

app :: IO ()
app :: Connection -> IO ()
app = undefined

0 comments on commit 8f3bd03

Please sign in to comment.