Skip to content

Commit

Permalink
update: misc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzNotABug committed May 24, 2024
1 parent 46d84b8 commit d30fd4b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion function/utils/middlewares.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ import noCookies from '@itznotabug/appexpress-nocookies';
import { authUserForConsoleMiddleware } from '../middlewares/auth.js';

export default (express) => {
logEverything(express);
cacheEverything(express);
favIconMiddleware(express);
minifierMiddleware(express);
express.middleware(noCookies.middleware);
express.middleware(authUserForConsoleMiddleware);
};

const logEverything = (express) => {
express.middleware((request) => {
const url = request.url;

// this log won't be considered unsupported!
console.log(`Requested Path: ${request.path}`);
console.log(`Requested Path: ${url}`);
if (apiCache.hasCache(url)) {
console.log(`This url (${url}) is cached!`);
}
});
};

Expand Down

0 comments on commit d30fd4b

Please sign in to comment.