Read bind port from the environment

master
rnhmjoj 2015-04-08 12:54:14 +02:00
parent 55f3f2692d
commit c42f195412
1 changed files with 7 additions and 1 deletions

View File

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