Read bind port from the environment
This commit is contained in:
parent
55f3f2692d
commit
c42f195412
8
Main.hs
8
Main.hs
@ -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)
|
Loading…
Reference in New Issue
Block a user