Configuration for JS - munichbughunter/SevenFacette GitHub Wiki
7Facette provides the possibility of using configuration files. In your config folder create a file called facetteConfig.json. This JSON-File has the following structure:
{
"sevenFacette": {
"log": {
"level": "INFO"
},
"http": {
"clients": {
"testClient": {
"url": {
"baseUrl": "conduit.productionready.io/api",
"protocol": "https"
}
}
}
},
"kafka": {
"bootstrapServer": "localhost:9092",
"consumer": {
"testConsumer": {
"useSASLAuthentication": false,
"autoOffset": "earliest",
"topicName": "test",
"maxConsumingTime": 60000
},
"topic2": {
"autoOffset": "earliest",
"bootstrapServer": "development-kafka.de:9191"
}
},
"producer": {
"testProducer": {
"useSASLAuthentication": false,
"autoOffset": "latest",
"topicName": "test"
}
}
},
"application": {
"resources": [
{
"name": "db1",
"path": "/database/db1/"
},
{
"name": "postgres",
"path": "/database/db2/"
},
{
"name": "testdb",
"path": "/rest/db3/"
}
]
},
"custom": {
"test": "test"
}
}
}
If multiple environments exist, different configuration files can be created - one for each environment. To use different files set an environment variable FACETTE_CONFIG with the corresponding filename as value. By this, the chosen file will be used.
7Facette provides the following log levels with colour codes:
NONE (default)
ERROR (red)
WARN (yellow)
INFO (white)
DEBUG (white)
In different cases, it is recommended to use environment variables, e.g. for usernames and passwords. You can use these variables by typing
[[variableName]] like this: "baseUrl": "[[BASE_URL]]"
inside the JSON file. There is also the possibility to use default values as a fallback. They are inside the square brackets separated from the variable name by pipes [[variableName || fallback value]]
.