aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs8
1 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 }