File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
serving/samples/helloworld-haskell Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,11 @@ following instructions recreate the source files from this folder.
6363 import Web.Scotty.Trans
6464
6565 main :: IO ()
66- main = do
67- t <- fromMaybe "World" <$> lookupEnv "TARGET"
68- scotty 8080 (route t)
66+ main = do
67+ t <- fromMaybe "World" <$> lookupEnv "TARGET"
68+ pStr <- fromMaybe "8080" <$> lookupEnv "PORT"
69+ let p = read pStr :: Int
70+ scotty p (route t)
6971
7072 route :: String -> ScottyM()
7173 route t = get "/" $ hello t
Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ import Web.Scotty.Trans
1111main :: IO ()
1212main = do
1313 t <- fromMaybe " World" <$> lookupEnv " TARGET"
14- scotty 8080 (route t)
14+ pStr <- fromMaybe " 8080" <$> lookupEnv " PORT"
15+ let p = read pStr :: Int
16+ scotty p (route t)
1517
1618route :: String -> ScottyM ()
1719route t = get " /" $ hello t
You can’t perform that action at this time.
0 commit comments