You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this.expressApp.use('/api/docs',express.static(path.join(__dirname,'../docs')));// Docs without apikey
117
115
118
116
this.expressRouter=express.Router();
119
-
117
+
120
118
// Route for testing the api at http://mirror:8080/api/test
121
119
this.expressRouter.route(['/test','/'])// Test without apiKey
122
120
.get((req,res)=>{
@@ -178,12 +176,12 @@ module.exports = {
178
176
'/togglefullscreen',
179
177
'/devtools'
180
178
]).get((req,res)=>{
181
-
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
179
+
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
res.status(400).json({success: false,message: `Invalid value ${val} provided in request. Use /api/classes to see actual values`});
195
193
}
196
194
});
197
-
195
+
198
196
this.expressRouter.route('/command/:value')
199
197
.get((req,res)=>{
200
-
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
198
+
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
res.status(400).json({success: false,message: "Invalid method, use POST"});
232
230
})
233
231
.post((req,res)=>{
234
-
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
232
+
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
res.status(400).json({success: false,message: "Invalid URL provided in request body"});
239
237
}
240
238
});
241
-
242
-
//edit config, payload is completely new config object with your changes(edits).
239
+
240
+
//edit config, payload is completely new config object with your changes(edits).
243
241
this.expressRouter.route('/config/edit')
244
242
.get((req,res)=>{
245
243
res.status(400).json({success: false,message: "Invalid method, use POST"});
246
244
})
247
245
.post((req,res)=>{
248
-
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
246
+
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
257
+
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
260
258
this.answerNotifyApi(req,res);
261
259
})
262
260
.post((req,res)=>{
263
-
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
261
+
if(!this.apiKey&&this.secureEndpoints)returnres.status(403).json({success: false,message: "Forbidden: API Key Not Provided in Config! Use secureEndpoints to bypass this message"});
0 commit comments