Skip to content

Commit 309679e

Browse files
committed
add referrer to logs
1 parent b05c73b commit 309679e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sample-server.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ http
1616
);
1717

1818
app.use((req, res, next) => {
19-
console.log("[" + new Date().toISOString() + "] " + req.originalUrl);
19+
console.log(
20+
"[" +
21+
new Date().toISOString() +
22+
"] " +
23+
" (" +
24+
req.headers.referer +
25+
") " +
26+
req.originalUrl
27+
);
2028
next();
2129
});
2230

0 commit comments

Comments
 (0)