fix: reduce local server status overhead
This commit is contained in:
@@ -451,7 +451,7 @@ export const registerSettingsUtilityRoutes = (app, dependencies) => {
|
||||
};
|
||||
|
||||
export const registerCommonRequestMiddleware = (app, dependencies) => {
|
||||
const { express } = dependencies;
|
||||
const { express, verboseRequestLogs = false } = dependencies;
|
||||
|
||||
app.use((req, res, next) => {
|
||||
if (req.path.startsWith('/api/behavior')) {
|
||||
@@ -492,7 +492,9 @@ export const registerCommonRequestMiddleware = (app, dependencies) => {
|
||||
app.use(express.urlencoded({ extended: true, limit: '50mb' }));
|
||||
|
||||
app.use((req, _res, next) => {
|
||||
console.log(`${new Date().toISOString()} - ${req.method} ${req.path}`);
|
||||
if (verboseRequestLogs) {
|
||||
console.log(`${new Date().toISOString()} - ${req.method} ${req.path}`);
|
||||
}
|
||||
next();
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user