mirror of
https://github.com/snoyberg/keter.git
synced 2025-01-05 21:36:40 +03:00
Sample app has environment info
This commit is contained in:
parent
235ceca5bb
commit
2baaf48a89
@ -15,3 +15,4 @@ static-hosts:
|
|||||||
redirects:
|
redirects:
|
||||||
- from: mysite.com
|
- from: mysite.com
|
||||||
to: www.mysite.com
|
to: www.mysite.com
|
||||||
|
postgres: true
|
||||||
|
@ -15,6 +15,7 @@ main = do
|
|||||||
fp <- canonicalizePath "."
|
fp <- canonicalizePath "."
|
||||||
[msg] <- getArgs
|
[msg] <- getArgs
|
||||||
portS <- getEnv "PORT"
|
portS <- getEnv "PORT"
|
||||||
|
env <- getEnvironment
|
||||||
let port = read portS
|
let port = read portS
|
||||||
logger <- mkRequestLogger def
|
logger <- mkRequestLogger def
|
||||||
{ outputFormat = Apache FromHeader
|
{ outputFormat = Apache FromHeader
|
||||||
@ -25,7 +26,12 @@ main = do
|
|||||||
liftIO $ hPutStrLn stderr $ "Testing standard error"
|
liftIO $ hPutStrLn stderr $ "Testing standard error"
|
||||||
liftIO $ hFlush stderr
|
liftIO $ hFlush stderr
|
||||||
return $ responseLBS status200 [("content-type", "text/plain")] $ L8.pack $ unlines
|
return $ responseLBS status200 [("content-type", "text/plain")] $ L8.pack $ unlines
|
||||||
[ "Message: " ++ msg
|
$ ("Message: " ++ msg)
|
||||||
, "Path: " ++ fp
|
: ("Path: " ++ fp)
|
||||||
, "Headers: " ++ show (requestHeaders req)
|
: ("Headers: " ++ show (requestHeaders req))
|
||||||
]
|
: map (\(k, v) -> concat
|
||||||
|
[ "Env: "
|
||||||
|
, k
|
||||||
|
, " = "
|
||||||
|
, v
|
||||||
|
]) env
|
||||||
|
Loading…
Reference in New Issue
Block a user