Skip to content

WebFramework settings

Semyon Gritsenko edited this page Jan 25, 2022 · 9 revisions

WebFramework uses this list of settings:

in WebServer object:

  1. ip(default: 0.0.0.0)
  2. port(default: 80)
  3. timeout(default: 0) // wait for connection (0 means infinite wait)

in WebFramework object:

  1. settingsPath[](default: web.json) // contains executors description
  2. loadSource[](default: current) // array of executors sources(current process, dlls)
  3. assetsPath(default: assets) // path to folder with files for ResourceExecutor
  4. usingAssetsCache(default: true) // setting for ResourceExecutor(if ResourceExecutor load asset first time, it holds in cache)
  5. templatesPath(default: templates) // path to folder with templates for WebFrameworkDynamicPages
  6. webServerType(default: multiThreaded) // (multiThreaded, threadPool) multi threaded or thread pool server model
  7. HTTPS object:
    • useHTTPS(default: false) // use or not HTTPS
    • pathToCertificate // path to cert.pem
    • pathToKey // path to key.pem

in Logging object:

  1. usingLogging(default: true) // initialize logging system
  2. dateFormat(default: DMY) // every log contains date information(DMY, MDY, YMD)
  3. addNewLineAfterLog(default: true) // if your log message already has endline symbol you can off this setting

Example

{
  "WebServer": {
    "ip": "0.0.0.0",
    "port": "80",
    "timeout": 0
  },

  "WebFramework": {
    "settingsPaths": [
      "another.json",
      "default.json"
    ],
    "loadSources": [
      "current"
    ],
    "assetsPath": "assets",
    "templatesPath": "templates",
    "usingAssetsCache": true,
    "webServerType": "multiThreaded",
    "HTTPS": {
      "useHTTPS": false,
      "pathToCertificate": "certificates/cert.pem",
      "pathToKey": "certificates/key.pem"
    }
  },

  "Logging": {
    "usingLogging": true,
    "dateFormat": "DMY",
    "addNewLineAfterLog": true
  },

  "ThreadPoolServer": {
    "threadCount": 0
  }
}

Clone this wiki locally