Skip to content

Configuration Elements

Overview

The configuration is divided into two sections: clientConfiguration and serverConfiguration. These sections serve distinct purposes and should not be accessed from the opposite side of where the code is running.

  • clientConfiguration: Contains configuration values for the client-side application and is sent to the browser.
  • serverConfiguration: Contains configuration values required on the server. This section should not be accessed from the client, as doing so would require exposing the entire configuration document to all users.

If there are configuration values that need to be accessed on both the client and server, they should be duplicated between clientConfiguration and serverConfiguration rather than exposing the entire configuration document across both environments.

Example Configuration

Note: This is only an example and is not a complete list of configuration settings.

Client Configuration

The clientConfiguration section holds values required by the client-side application. These values are accessible from the browser and should not contain any sensitive or server-only information.

   "clientConfiguration" : {
        "commandBarCSS" : {
            "background" : "white"
        },
        "addressMapZoomLevel" : 15,
        "dateFormat" : {
            "date" : "dd/MM/yyyy",
            "general" : "dd/MM/yyyy hh:mm a",
            "shortMonth" : "dd/MMM/yyyy hh:mm a",
            "time" : "hh:mm a"
        },
        "imageViewer" : {
            "extensionNameMap" : {
                "DOC" : "Word 97-2003 Document",
                "DOCX" : "Word Document",
                "PPT" : "PowerPoint 97-2003 Presentation",
                "PPTX" : "PowerPoint Presentation",
                "XLS" : "Excel 97-2003 Workbook",
                "XLSX" : "Excel Workbook"
            },
           "supportedExtensions" : [ 
               "png", 
               "jpg", 
               "jpeg", 
               "gif", 
               "tif", 
               "tiff", 
               "bmp", 
               "png", 
               "psd", 
               "psp", 
               "svg"
           ],
           "supportedVideo" : [ 
               "ogg", 
               "mp4", 
               "webm"
           ]
       },
       "defaultTemplate" : "54d96f610bc006eb84369a8b",
       "minAutoCompleteLength" : 3,
       "useCurrentLocation" : false
    }

Server Configuration

The serverConfiguration section holds values required by the server-side application and should not be accessible from the client.

   "serverConfiguration" : {
        "fileStorage" : {
            "type" : "PlainDirectory",
            "path" : "/formbird/files"
       },
       "fileUploader" : {
           "defaultTemplateId" : "2d5d90f0-9da9-11e7-b329-9f0a52692ed3",
           "relatedDocumentField" : "relatedDocument",
           "fileUploaderField" : "fileDetails",
           "extensionWhitelist" : [ 
                "json", 
                "jpeg", 
                "jpg", 
                "png", 
                "tiff", 
                "bmp", 
                "gif", 
                "txt", 
                "docx", 
                "doc", 
                "ppt", 
                "pptx", 
                "xlsx", 
                "xls", 
                "zip", 
                "rar", 
                "7zip", 
                "gzip"
           ]
       },
       "urlBasePath" : "",
       "preferCachedData" : true,
       "authenticationMaxAge" : 900000,
       "elasticsearch" : {
            "host" : "localhost:9200",
            "fuzzyPrefixLength" : 0
        },
        "httpsEnabled" : true,
        "maxUploadSize" : "6MB"
    }

Important Notes

  • The serverConfiguration section should not be accessed from the client to avoid exposing sensitive details.
  • Database connection details should not be stored here; they should go in a separate configuration file.
  • If a configuration value is required by both the client and server, it should be duplicated in both sections to avoid cross-access.