devnotes.

app.disable() Function

app.disable() turns a boolean application setting off, shorthand for app.set(name, false).

Syntax

app.disable(name)

Example

const express = require("express");
const app = express();

app.enable("trust proxy");
app.disable("trust proxy");
console.log(app.get("trust proxy")); // false

Use cases

  • Disabling trust proxy when the app is not behind a proxy.
  • Turning off case-sensitive routing.
  • Reverting a setting to its default false state.
app.disable() Function | DevNotes