2023-01-15 16:38:57 +01:00
|
|
|
module Main (main) where
|
|
|
|
|
2023-01-15 18:26:41 +01:00
|
|
|
import ClassyPrelude
|
2023-06-20 17:54:50 +02:00
|
|
|
import GHC.IO.Encoding (setLocaleEncoding)
|
|
|
|
import GHC.IO.Encoding.UTF8 (utf8)
|
2023-01-15 18:26:41 +01:00
|
|
|
import Lib (runBothServers)
|
2025-01-20 20:40:17 +01:00
|
|
|
import Options.Applicative
|
|
|
|
import Types.Config (ServerOptions, serverOptionsParser)
|
2023-01-15 16:38:57 +01:00
|
|
|
|
|
|
|
main :: IO ()
|
2023-06-20 17:54:50 +02:00
|
|
|
main = do
|
|
|
|
setLocaleEncoding utf8
|
2025-01-19 13:30:56 +01:00
|
|
|
hSetBuffering stdout LineBuffering
|
|
|
|
hSetBuffering stderr LineBuffering
|
2025-01-20 20:40:17 +01:00
|
|
|
|
|
|
|
opts <- execParser serverOptions
|
|
|
|
|
|
|
|
runBothServers opts
|
|
|
|
|
|
|
|
serverOptions :: ParserInfo ServerOptions
|
|
|
|
serverOptions =
|
|
|
|
info
|
|
|
|
(serverOptionsParser <**> helper)
|
|
|
|
( fullDesc
|
|
|
|
<> progDesc "Run the server with specified options"
|
|
|
|
<> header "Haskell Server - A configurable server application"
|
|
|
|
)
|