Commit 50bbf679 authored by Bas Lijnse's avatar Bas Lijnse

Added application specific generic config to engine options

parent 0131c660
Pipeline #30962 passed with stage
in 6 minutes and 27 seconds
......@@ -61,6 +61,7 @@ instance Startable (a,b) | Startable a & Startable b
{ appName :: String
, appPath :: FilePath // Location of the application's executable
, appVersion :: String
, appConfig :: Map String String //Application specific configuration
, serverPort :: Int
, serverUrl :: String
, allowedHosts :: [String] // Only allow connections from these hosts (default ["127.0.0.1"])
......
......@@ -29,6 +29,7 @@ import iTasks.WF.Tasks.System
import iTasks.WF.Derives
import qualified Data.Map as DM
import Data.Map.GenJSON
from TCPIP import :: Timeout
from StdFunc import :: St, seqList
......@@ -211,6 +212,7 @@ defaultEngineOptions world
{ appName = appName
, appPath = appPath
, appVersion = appVersion
, appConfig = 'DM'.newMap
, serverPort = IF_POSIX_OR_WINDOWS 8080 80
, serverUrl = "http://localhost/"
, allowedHosts = ["127.0.0.1"]
......
......@@ -65,3 +65,4 @@ applicationName :: SDSSource () String () // Application name
applicationVersion :: SDSSource () String () // Application build identifier
applicationDirectory :: SDSSource () FilePath () // Directory in which the applicaton resides
applicationOptions :: SDSSource () EngineOptions () //Full engine options
applicationConfig :: SDSLens () (Map String String) () //Just the application specific config from engine options
......@@ -162,4 +162,6 @@ applicationOptions = createReadOnlySDS options
where
options () iworld=:{IWorld|options} = (options,iworld)
applicationConfig :: SDSLens () (Map String String) ()
applicationConfig = mapRead (\{EngineOptions|appConfig} -> appConfig) applicationOptions
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment