Skip to content

Commit

Permalink
forgot to commit routes.js
Browse files Browse the repository at this point in the history
  • Loading branch information
litsel-pitdyr committed Jan 6, 2025
1 parent 55aedd5 commit a3cae62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { Router } = require('express');
const { cache } = require("./app.js");
const routes = Router();

routes.get('/default', (req, res) => {return res.status(200).json({ message: 'Router route' })});
routes.post('/toggle-restricted-proxy', (req, res) => {
const cache = req.app.get('cache');
let currentValue = cache.get("restrictedProxy");
if (currentValue === undefined) {
currentValue = false;
Expand All @@ -17,6 +17,7 @@ routes.post('/toggle-restricted-proxy', (req, res) => {
return res.status(200).json({ success: true, restrictedProxy: newValue });
});
routes.get('/restricted-proxy-status', (req, res) => {
const cache = req.app.get('cache');
const currentValue = cache.get("restrictedProxy");
console.log({ restrictedProxy: currentValue });

Expand Down

0 comments on commit a3cae62

Please sign in to comment.