Files
habitica/website/server/middlewares/ensureDevelopmentMode.js
Natalie 2a2c1af7ba Add rage button to debug menu (#15291)
* + Rage

* tinkering

* remove if statement wrapper and modify error message

* add test cases

* more work on test cases

* adding contexts to test cases

* test(debug): fix up tests

* fix(lint): whisepate

---------

Co-authored-by: Sabe Jones <sabe@habitica.com>
2024-08-13 00:34:37 -05:00

13 lines
282 B
JavaScript

import nconf from 'nconf';
import {
NotFound,
} from '../libs/errors';
export default function ensureDevelopmentMode (req, res, next) {
if (nconf.get('DEBUG_ENABLED') && nconf.get('BASE_URL') !== 'https://habitica.com') {
next();
} else {
next(new NotFound());
}
}