Configuration of a web application is realized in the section application of the configuration file smartweb.json.

Here, it is possible to define an inactivity period of a logged on user (with at least one opened SmartWeb page) in minutes after which the user will be automatically logged out (userSessionMaxInactivePeriod), if this attribute is not defined directly on the object user in the D2000 system. The period after closing all tabs, after which the session of a logged on user will be closed, is defined by the attribute httpSessionMaxInactivePeriod. 

The development section

In the development section, the developing regime of the access to the page in permitted (devModeEnabled, the keyboard shortcut CTRL+ALT+D is also permitted); rebundling of an application in permitted too (rebundlingEnabled, the keyboard shortcut CRTL+ALT+R).

The webResourceDirectories section

In this section, it is necessary to define whole path to the application directory (directoryPath). Necessary JavaScript libraries (dependencies), which will be automatically downloaded, are defined here. The attribute downloadBundleEngine defines whether there should be a bundle engine downloaded before the application start - this is necessary only when first starting the application. By the attribute downloadProxyUrl, the address of the proxy server is set, if it is necessary. The attribute bundleAtServerStart defines whether the application should be rebundled when starting the web server - it is necessary only when the source files of pages have been modified and rebundling was not called manually. 

smartweb.json
{
    "application": {
        "httpSessionMaxInactivePeriod": "5",
        "userSessionMaxInactivePeriod": "30",


        // Development section defines if DEV mode and rebundling operation is enabled (default values are true)
        "development": {
            "devModeEnabled": "true",
            "rebundlingEnabled": "true"
        },

        // Definition of application resource directories and corresponding configuration of SmartWeb Bundle Engine
        "webResourceDirectories": [
            {
                "type": "APPLICATION",
                "downloadBundleEngine": "true",
                "downloadProxyUrl": "http://proxy:3128",
                "bundleAtServerStart": "true",
                "applicationFilesFilter": "glob:{*.js,pages/*.js}",
                "componentFilesFilter": "glob:{custom/components.js}",
                "dependencies": [
                    "npm:bootstrap@3.3.7"
                ],
                "directoryPath": "D:\\IdeaProjects\\smart-web\\cust\\cust-tutorial\\cust-tutorial-src\\src\\main\\javascript\\app"
            }
        ]
    } 
}
Napíšte komentár