summaryrefslogtreecommitdiff
path: root/fig-frontend/main/Main.hs
blob: 47d10ab507e6857105cd3495f0fe856c10c8853a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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