Spaces:
Running
Running
Update app.js
Browse files
app.js
CHANGED
@@ -10,7 +10,7 @@ app.use(morgan('combined'));
|
|
10 |
|
11 |
// Route to count hits
|
12 |
app.get('/', (req, res) => {
|
13 |
-
const userAgent = req.headers
|
14 |
|
15 |
// Increment hit only if not from fetch
|
16 |
if (!userAgent || userAgent.toLowerCase().includes('fetch')) {
|
|
|
10 |
|
11 |
// Route to count hits
|
12 |
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')) {
|