mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
WIP(shops): safer debug mode
This commit is contained in:
12
website/server/middlewares/ensureDevelopmentMode.js
Normal file
12
website/server/middlewares/ensureDevelopmentMode.js
Normal file
@@ -0,0 +1,12 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user