Commit 8f4ffdcd authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Change gargantext-settings.toml for proxy sub-section

parent 0e037e1f
...@@ -19,6 +19,6 @@ allowed-origins = [ ...@@ -19,6 +19,6 @@ allowed-origins = [
use-origins-for-hosts = true use-origins-for-hosts = true
[microservices] [microservices.proxy]
port = 8009
proxy-port = 8009 enabled = false
...@@ -13,12 +13,14 @@ import Toml ...@@ -13,12 +13,14 @@ import Toml
data MicroServicesSettings = data MicroServicesSettings =
MicroServicesSettings { MicroServicesSettings {
-- | The port where the microservices proxy will be listening on. -- | The port where the microservices proxy will be listening on.
_msProxyPort :: Int _msProxyPort :: !Int
, _msProxyEnabled :: !Bool
} deriving (Show, Eq) } deriving (Show, Eq)
microServicesSettingsCodec :: TomlCodec MicroServicesSettings microServicesSettingsCodec :: TomlCodec MicroServicesSettings
microServicesSettingsCodec = MicroServicesSettings microServicesSettingsCodec = MicroServicesSettings
<$> Toml.int "proxy-port" .= _msProxyPort <$> Toml.int "port" .= _msProxyPort
<*> Toml.bool "enabled" .= _msProxyEnabled
mkProxyUrl :: GargConfig -> MicroServicesSettings -> BaseUrl mkProxyUrl :: GargConfig -> MicroServicesSettings -> BaseUrl
mkProxyUrl GargConfig{..} MicroServicesSettings{..} = mkProxyUrl GargConfig{..} MicroServicesSettings{..} =
......
...@@ -22,7 +22,7 @@ makeLenses ''GargTomlSettings ...@@ -22,7 +22,7 @@ makeLenses ''GargTomlSettings
settingsCodec :: TomlCodec GargTomlSettings settingsCodec :: TomlCodec GargTomlSettings
settingsCodec = GargTomlSettings settingsCodec = GargTomlSettings
<$> (Toml.table corsSettingsCodec "cors" .= _gargCorsSettings) <$> (Toml.table corsSettingsCodec "cors" .= _gargCorsSettings)
<*> (Toml.table microServicesSettingsCodec "microservices" .= _gargMicroServicesSettings) <*> (Toml.table microServicesSettingsCodec "microservices.proxy" .= _gargMicroServicesSettings)
-- | Extends the 'allowed-origins' in the CORSettings with the URLs embellished -- | Extends the 'allowed-origins' in the CORSettings with the URLs embellished
-- with the proxy port. -- with the proxy port.
......
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