fix: reduce local server status overhead

This commit is contained in:
Bohdan Triapitsyn
2026-05-05 18:47:00 +03:00
parent 962ee41bba
commit 6dd322ddbe
7 changed files with 60 additions and 20 deletions
@@ -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();
});
};