Roosevelt

Configuration — Development mode

🔝 Scroll to top

Development mode options

These features are only available in development mode.

  • frontendReload [Object]: Settings to use for the browser reload feature which automatically reloads your browser when your frontend code changes.
    • Options:
      • enable [Boolean]: Whether or not to enable this feature.
      • exceptionRoutes [Array of Strings]: List of routes to exclude from this feature.
      • expressBrowserReloadParams [Object]: Params to pass to express-browser-reload. This feature will only be active on pages with a <body> tag.

Default: [Object]

{
  enable: true,
  exceptionRoutes: [],
  expressBrowserReloadParams: {
    skipDeletingConnections: true
  }
}
  • htmlValidator [Object]: Parameters to send to express-html-validator.
    • enable [Boolean]: Enables or disables the built-in HTML validator.
    • exceptions [Object]: A set of params that can be used to prevent validation in certain scenarios.
      • header [String]: A custom header that when set will disable the validator on a per request basis.
      • modelValue [String]: An entry in your data model passed along with a res.render that when set will disable validation on the rendered HTML.
    • validatorConfig [Object]: html-validate configuration that determines what errors the validator looks for.
      • The full list of available validator rules can be found here.
      • This configuration can also be set by a .htmlValidate.json file placed in your app root directory.
    • You may also want to override the version of html-validate this module ships with by default, since that module has had a history of updating faster than this one does at times. To do so, set this in your app's package.json:
"overrides": {
  "html-validate": "x.y.z"
}

Where x.y.z is your desired version. After doing so, delete your node_modules folder and package-lock.json then run npm i to install the override.

  • mode [String]: Decides whether your app starts in production mode or development mode by default. Default: production.

Default: [Object]

{
  enable: true,
  exceptions: {
    requestHeader: 'Partial',
    modelValue: '_disableValidator'
  },
  validatorConfig: {}
}
  • deprecationChecks: [String] or [Boolean]: Whether or not to run the deprecation checker in Roosevelt. The deprecation checker is a script that runs when your app starts to determine if you have code targeting an older version of Roosevelt that needs to be refactored. Default: 'development-mode', which runs the checks in development mode only. Set to true to run them in every mode, or false to disable them entirely.
    • Most checks read your Roosevelt config. A few also read your controllers, views, and models, looking for app code written against something that has since changed. Nothing outside those directories is read, so your node_modules and build output are never searched.