diff options
| author | LLLL Colonq <llll@colonq> | 2024-03-01 22:52:43 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-03-01 22:52:43 -0500 |
| commit | 7aa60d33eff21ccdaa31ccd5dd64196990bb3dea (patch) | |
| tree | 516bbac3c84c171cd364672d7c15ca320839c5e2 /fig-frontend/main/Main.hs | |
| parent | 88e2726fc1fc6cec2b9e63526ce4c0a1a04a2e98 (diff) | |
Add test redeem message bus functionality
Diffstat (limited to 'fig-frontend/main/Main.hs')
| -rw-r--r-- | fig-frontend/main/Main.hs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/fig-frontend/main/Main.hs b/fig-frontend/main/Main.hs index 47d10ab..7db5efe 100644 --- a/fig-frontend/main/Main.hs +++ b/fig-frontend/main/Main.hs @@ -1,3 +1,5 @@ +{-# Language ApplicativeDo #-} + module Main where import Fig.Prelude @@ -7,13 +9,18 @@ import Options.Applicative import Fig.Frontend import Fig.Frontend.Utils -newtype Opts = Opts - { config :: FilePath +data Opts = Opts + { busHost :: Text + , busPort :: Text + , config :: FilePath } parseOpts :: Parser Opts -parseOpts = Opts - <$> strOption (long "config" <> metavar "PATH" <> help "Path to config file" <> showDefault <> value "fig-frontend.toml") +parseOpts = do + busHost <- strOption (long "bus-host" <> metavar "HOST" <> help "Address of message bus" <> value "localhost") + busPort <- strOption (long "bus-port" <> metavar "PORT" <> help "Message bus port" <> showDefault <> value "32050") + config <- strOption (long "config" <> metavar "PATH" <> help "Path to config file" <> showDefault <> value "fig-frontend.toml") + pure Opts{..} main :: IO () main = do @@ -22,4 +29,4 @@ main = do <> header "fig-frontend - public-facing web applications" ) cfg <- loadConfig opts.config - server cfg + server cfg (opts.busHost, opts.busPort) |
