inter-hub-haskell/Config/Config.hs

16 lines
476 B
Haskell
Raw Normal View History

module Config where
import IHP.Prelude
import IHP.Environment
import IHP.FrameworkConfig
import System.Environment (lookupEnv)
-- | Feature flag: set IHP_ANNOTATION_LAUNCHER=true to inject the JS launcher.
newtype AnnotationLauncherEnabled = AnnotationLauncherEnabled Bool deriving (Typeable)
config :: ConfigBuilder
config = do
launcherEnv <- liftIO (lookupEnv "IHP_ANNOTATION_LAUNCHER")
option (AnnotationLauncherEnabled (launcherEnv == Just "true"))
pure ()