mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
refactor: Setup middleware for all development routes
This commit is contained in:
committed by
Keith Holliday
parent
6921c1694a
commit
e056a62af0
@@ -4,6 +4,12 @@ import checkForDevelopmentMode from '../../middlewares/api-v3/developmentMode';
|
||||
|
||||
let api = {};
|
||||
|
||||
api.development = {
|
||||
method: 'all',
|
||||
url: '/development/*',
|
||||
middlewares: [checkForDevelopmentMode, authWithHeaders(), cron],
|
||||
};
|
||||
|
||||
/**
|
||||
* @api {post} /development/addTenGems Add ten gems to the current user
|
||||
* @apiVersion 3.0.0
|
||||
@@ -15,7 +21,6 @@ let api = {};
|
||||
api.addTenGems = {
|
||||
method: 'POST',
|
||||
url: '/development/addTenGems',
|
||||
middlewares: [checkForDevelopmentMode, authWithHeaders(), cron],
|
||||
async handler (req, res) {
|
||||
let user = res.locals.user;
|
||||
|
||||
@@ -38,7 +43,6 @@ api.addTenGems = {
|
||||
api.addHourglass = {
|
||||
method: 'POST',
|
||||
url: '/development/addHourglass',
|
||||
middlewares: [checkForDevelopmentMode, authWithHeaders(), cron],
|
||||
async handler (req, res) {
|
||||
let user = res.locals.user;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user