Restore code in the helloworld-haskell README (#661)

The code was deleted in 41462c6
This commit is contained in:
csamak 2018-12-17 21:40:34 -08:00 committed by Knative Prow Robot
parent df75e7e488
commit 07bcdda117
1 changed files with 18 additions and 18 deletions

View File

@ -53,28 +53,28 @@ recreate the source files from this folder.
listens on port 8080: listens on port 8080:
```haskell ```haskell
} {-# LANGUAGE OverloadedStrings #-}
e import Data.Maybe
) import Data.Monoid ((<>))
) import Data.Text.Lazy (Text)
y import Data.Text.Lazy
) import System.Environment (lookupEnv)
) import Web.Scotty (ActionM, ScottyM, scotty)
s import Web.Scotty.Trans
) main :: IO ()
o main = do
" t <- fromMaybe "World" <$> lookupEnv "TARGET"
" pStr <- fromMaybe "8080" <$> lookupEnv "PORT"
t let p = read pStr :: Int
) scotty p (route t)
) route :: String -> ScottyM()
t route t = get "/" $ hello t
) hello :: String -> ActionM()
) hello t = text $ pack ("Hello " ++ t)
``` ```
1. In your project directory, create a file named `Dockerfile` and copy the code 1. In your project directory, create a file named `Dockerfile` and copy the code