diff --git a/serving/samples/helloworld-haskell/README.md b/serving/samples/helloworld-haskell/README.md index e5a5d9b6d..effdada2a 100644 --- a/serving/samples/helloworld-haskell/README.md +++ b/serving/samples/helloworld-haskell/README.md @@ -63,9 +63,11 @@ following instructions recreate the source files from this folder. import Web.Scotty.Trans main :: IO () - main = do - t <- fromMaybe "World" <$> lookupEnv "TARGET" - scotty 8080 (route t) + main = do + t <- fromMaybe "World" <$> lookupEnv "TARGET" + pStr <- fromMaybe "8080" <$> lookupEnv "PORT" + let p = read pStr :: Int + scotty p (route t) route :: String -> ScottyM() route t = get "/" $ hello t diff --git a/serving/samples/helloworld-haskell/app/Main.hs b/serving/samples/helloworld-haskell/app/Main.hs index b16fc5f6a..0e35f7cbf 100644 --- a/serving/samples/helloworld-haskell/app/Main.hs +++ b/serving/samples/helloworld-haskell/app/Main.hs @@ -11,7 +11,9 @@ import Web.Scotty.Trans main :: IO () main = do t <- fromMaybe "World" <$> lookupEnv "TARGET" - scotty 8080 (route t) + pStr <- fromMaybe "8080" <$> lookupEnv "PORT" + let p = read pStr :: Int + scotty p (route t) route :: String -> ScottyM() route t = get "/" $ hello t