summaryrefslogtreecommitdiff
path: root/fig-frontend/main/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'fig-frontend/main/Main.hs')
-rw-r--r--fig-frontend/main/Main.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/fig-frontend/main/Main.hs b/fig-frontend/main/Main.hs
new file mode 100644
index 0000000..47d10ab
--- /dev/null
+++ b/fig-frontend/main/Main.hs
@@ -0,0 +1,25 @@
+module Main where
+
+import Fig.Prelude
+
+import Options.Applicative
+
+import Fig.Frontend
+import Fig.Frontend.Utils
+
+newtype Opts = Opts
+ { config :: FilePath
+ }
+
+parseOpts :: Parser Opts
+parseOpts = Opts
+ <$> strOption (long "config" <> metavar "PATH" <> help "Path to config file" <> showDefault <> value "fig-frontend.toml")
+
+main :: IO ()
+main = do
+ opts <- execParser $ info (parseOpts <**> helper)
+ ( fullDesc
+ <> header "fig-frontend - public-facing web applications"
+ )
+ cfg <- loadConfig opts.config
+ server cfg