UNPKG

mongorai

Version:

Light MongoDB client for the web. Minimalistic UI used React with minimum dependencies.

17 lines (16 loc) 454 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.writeEnabled = writeEnabled; const MONGORAI_READ_ONLY_MODE = process.env.MONGORAI_READ_ONLY_MODE === 'true'; function writeEnabled(_, res, next) { if (MONGORAI_READ_ONLY_MODE) { res.status(405); return res.json({ ok: false, message: "You can't do this in read-only mode", }); } else { next(); } }