Skip to content

Commit a12fedf

Browse files
committed
Fixed the endpoint
1 parent 2e3c753 commit a12fedf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/middlewares/logger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const requestLogger = async (req, res, next) => {
9494
const now = new Date();
9595
const dateKey = now.toISOString().split('T')[0]; // "YYYY-MM-DD"
9696
const pathSegments = req.path.split('/').filter(Boolean); // Remove empty segments
97-
const endpoint = pathSegments.length > 2 ? pathSegments[pathSegments.length - 2] : pathSegments.pop();
97+
const endpoint = pathSegments[2];
9898

9999
const IMAGE_URL = 'https://i.imgur.com/c55SNmu.png';
100100
hook.setUsername('API Logger');

0 commit comments

Comments
 (0)