mirror of https://github.com/knative/docs.git
Restore code in the helloworld-haskell README (#661)
The code was deleted in 41462c6
This commit is contained in:
parent
df75e7e488
commit
07bcdda117
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue