pluviouse commited on
Commit
f21a2b1
·
verified ·
1 Parent(s): d3efcd3

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +2 -2
app.js CHANGED
@@ -13,7 +13,7 @@ app.get('/', (req, res) => {
13
  const userAgent = req.headers['user-agent'];
14
 
15
  // Increment hit only if not from fetch
16
- if (!userAgent || userAgent.toLowerCase().includes('fetch')) {
17
  hitCount++;
18
  }
19
 
@@ -21,7 +21,7 @@ app.get('/', (req, res) => {
21
  message: 'Welcome to the hit counter!',
22
  hits: hitCount,
23
  userAgent: userAgent,
24
- counted: !userAgent?.toLowerCase().includes('fetch')
25
  });
26
  });
27
 
 
13
  const userAgent = req.headers['user-agent'];
14
 
15
  // Increment hit only if not from fetch
16
+ if (!userAgent || userAgent?.toLowerCase().includes('fetch')) {
17
  hitCount++;
18
  }
19
 
 
21
  message: 'Welcome to the hit counter!',
22
  hits: hitCount,
23
  userAgent: userAgent,
24
+ counted: userAgent?.toLowerCase().includes('fetch')
25
  });
26
  });
27