My configuration file contains a field for a web server port. I'd like to read the value from an environment variable, but doing so always treats it as a string.
Running with FOO exported to 3000 causes this error:
ConfigError {
configErrorLocation = Key "" "server-port",
configConversionError = Just [
ConversionError {
conversionErrorLoc = "boundedIntegerValue",
conversionErrorWhy = TypeError,
conversionErrorVal = Just (String "3000"),
conversionErrorType = Just Int,
conversionErrorMsg = Nothing
}
]
}
I tried this too
but it reports ParseError "test.conf" "endOfInput".
Is there something I can do in my code to allow both literal integers and those from environment variables?
(Context: PostgREST/postgrest#826)
My configuration file contains a field for a web server port. I'd like to read the value from an environment variable, but doing so always treats it as a string.
Running with FOO exported to 3000 causes this error:
I tried this too
server-port = $(FOO)but it reports
ParseError "test.conf" "endOfInput".Is there something I can do in my code to allow both literal integers and those from environment variables?
(Context: PostgREST/postgrest#826)