Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a helper function to read the command line arguments using the optparse-applicative and the AppConfig type to store them. It also can be used to define other middleware configuration that may be delegated to some sort of external configuration.
It currently includes a hardcoded CORS policy but this could easly be turned in configurable behaviour if needed.
Other hardcoded options such as the minimum version number also belong here.
Synopsis
- prettyVersion :: Text
- docsVersion :: Text
- readOptions :: IO AppConfig
- corsPolicy :: Request -> Maybe CorsResourcePolicy
- data AppConfig = AppConfig {
- configDatabase :: Text
- configAnonRole :: Text
- configProxyUri :: Maybe Text
- configSchema :: Text
- configHost :: Text
- configPort :: Int
- configSocket :: Maybe Text
- configJwtSecret :: Maybe ByteString
- configJwtSecretIsBase64 :: Bool
- configJwtAudience :: Maybe StringOrURI
- configPool :: Int
- configPoolTimeout :: Int
- configMaxRows :: Maybe Integer
- configReqCheck :: Maybe Text
- configQuiet :: Bool
- configSettings :: [(Text, Text)]
- configRoleClaimKey :: Either ApiRequestError JSPath
- configExtraSearchPath :: [Text]
- configRootSpec :: Maybe QualifiedIdentifier
- configRawMediaTypes :: [ByteString]
- configPoolTimeout' :: Fractional a => AppConfig -> a
Documentation
prettyVersion :: Text Source #
User friendly version number
docsVersion :: Text Source #
Version number used in docs
readOptions :: IO AppConfig Source #
Function to read and parse options from the command line
corsPolicy :: Request -> Maybe CorsResourcePolicy Source #
CORS policy to be used in by Wai Cors middleware
Config file settings for the server
configPoolTimeout' :: Fractional a => AppConfig -> a Source #