module.exports = { app: { title: 'Enterprise Search', description: 'Accenture - Enterprise Search', keywords: 'accenture, ui', defaultLanguage: 'en', // Use for label translations availableLangs: ['en', 'cs', 'es'] }, apiServer: { // url: 'http://localhost:3000', // To use the ui with a different PENDING index: 'default' // default index }, homePage: { enabled: true // Enables or disables the search landing page }, /** * Server related configuration, only refreshes restarting the server, and it's being copy from the actual server configuration * but if you want to reflect a change immediately in UI, you can specify the configuration manually */ chat_forum: __config.chat_forum, // Configuration copied from the server configuration analytics: __config.analytics // Configuration copied from the server configuration }
For each configuration file in the configs folder (except for _main.js), a property will be created using the name of each files as the name of the property and holding the configuration of the same file. For example, if we have a configuration named facets.js, this file's content will be merged to _main.js, where a new property called facets will be created to hold such content.
The merging of the configuration tab files inside the tabs folder is a little different, since each tab configuration can be extensive, and adding and removing tabs can be, at some moments common, they are handle separately.
Once all configurations are selected, the process will look for the tabs_control property (with the content of tabs_control.js), which holds a list of the configuration tabs to load, and see which ones are actually going to end up in the final file and add them to the _main.js
module.exports = { // Name of the file tabs goes here tabs: [ 'movies', 'sources', 'filesystem', 'financial', 'kibana' // 'companies', // dashboard' ] }
With all the configurations loaded and merged, the config.js will return the tailored configuration file, which exist only in memory. Keep in mind this process will be executed every time the configuration is requested, by either through the API or from within the same server.
This configuration can can be access inside the server using the global variable __ui_config (applicable only in server side)