diff options
-rw-r--r-- | app/Main.hs | 8 | ||||
-rw-r--r-- | tracktrain.cabal (renamed from haskell-gtfs.cabal) | 0 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/Main.hs b/app/Main.hs index e47ffc4..ec4b5e7 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE LambdaCase #-} + -- | The main module. Does little more than handle some basic ocnfic, then -- call the server module Main where @@ -11,14 +13,18 @@ import Network.Wai.Handler.Warp (run) import Network.Wai.Middleware.RequestLogger (OutputFormat (..), RequestLoggerSettings (..), mkRequestLogger) +import System.Environment (getArgs) +import Data.Functor ((<&>)) +import Data.ByteString.Internal (packChars) import GTFS import Server -connStr = "user=travelynx" main :: IO () main = do + connStr <- getArgs <&> \case {[str] -> packChars str; _ -> ""} + gtfs <- loadGtfs "./gtfs.zip" loggerMiddleware <- mkRequestLogger $ def { outputFormat = Detailed True } diff --git a/haskell-gtfs.cabal b/tracktrain.cabal index ec312ee..ec312ee 100644 --- a/haskell-gtfs.cabal +++ b/tracktrain.cabal |