From 7aa60d33eff21ccdaa31ccd5dd64196990bb3dea Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 1 Mar 2024 22:52:43 -0500 Subject: Add test redeem message bus functionality --- fig-frontend/main/Main.hs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'fig-frontend/main/Main.hs') 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) -- cgit v1.2.3