Read bind port from the environment

This commit is contained in:
rnhmjoj 2015-04-08 12:54:14 +02:00
parent 55f3f2692d
commit c42f195412

View File

@ -2,8 +2,14 @@
module Main where module Main where
import Application import Application
import Control.Applicative
import System.Environment
import Network.Wai.Handler.Warp import Network.Wai.Handler.Warp
import Network.Wai.Middleware.RequestLogger import Network.Wai.Middleware.RequestLogger
main :: IO () main :: IO ()
main = app (run 3000 . logStdout) main = do
port <- maybe 3000 read <$> lookupEnv "PORT"
app (run port . logStdout)