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