@webtypen/webframez-core 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Router/Request.d.ts +1 -0
- package/lib/Router/Router.js +30 -0
- package/package.json +1 -1
- package/src/Router/Request.ts +1 -0
- package/src/Router/Router.ts +34 -0
package/lib/Router/Request.d.ts
CHANGED
package/lib/Router/Router.js
CHANGED
|
@@ -287,6 +287,36 @@ class RouterFacade {
|
|
|
287
287
|
if (Config_1.Config.get("router.requests.logConsole") !== true) {
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
|
+
const date = new Date();
|
|
291
|
+
const month = date.getMonth() + 1;
|
|
292
|
+
const ip = req.headers["x-forwarded-for"]
|
|
293
|
+
? req.headers["x-forwarded-for"]
|
|
294
|
+
: req.headers["x-forwarded"]
|
|
295
|
+
? req.headers["x-forwarded"]
|
|
296
|
+
: req.headers["forwarded-for"]
|
|
297
|
+
? req.headers["forwarded-for"]
|
|
298
|
+
: req.socket && req.socket.remoteAddress
|
|
299
|
+
? req.socket.remoteAddress
|
|
300
|
+
: null;
|
|
301
|
+
console.log('{ date: "' +
|
|
302
|
+
date.getFullYear() +
|
|
303
|
+
"-" +
|
|
304
|
+
(month < 10 ? "0" + month : month) +
|
|
305
|
+
"-" +
|
|
306
|
+
date.getDate() +
|
|
307
|
+
" " +
|
|
308
|
+
(date.getHours() + 1) +
|
|
309
|
+
":" +
|
|
310
|
+
date.getMinutes() +
|
|
311
|
+
":" +
|
|
312
|
+
date.getSeconds() +
|
|
313
|
+
'", method: "' +
|
|
314
|
+
req.method +
|
|
315
|
+
'", url: "' +
|
|
316
|
+
req.url +
|
|
317
|
+
'", ip: "' +
|
|
318
|
+
ip +
|
|
319
|
+
'" }');
|
|
290
320
|
}
|
|
291
321
|
}
|
|
292
322
|
exports.Router = new RouterFacade();
|
package/package.json
CHANGED
package/src/Router/Request.ts
CHANGED
package/src/Router/Router.ts
CHANGED
|
@@ -346,6 +346,40 @@ class RouterFacade {
|
|
|
346
346
|
if (Config.get("router.requests.logConsole") !== true) {
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
|
+
|
|
350
|
+
const date = new Date();
|
|
351
|
+
const month = date.getMonth() + 1;
|
|
352
|
+
const ip = req.headers["x-forwarded-for"]
|
|
353
|
+
? req.headers["x-forwarded-for"]
|
|
354
|
+
: req.headers["x-forwarded"]
|
|
355
|
+
? req.headers["x-forwarded"]
|
|
356
|
+
: req.headers["forwarded-for"]
|
|
357
|
+
? req.headers["forwarded-for"]
|
|
358
|
+
: req.socket && req.socket.remoteAddress
|
|
359
|
+
? req.socket.remoteAddress
|
|
360
|
+
: null;
|
|
361
|
+
|
|
362
|
+
console.log(
|
|
363
|
+
'{ date: "' +
|
|
364
|
+
date.getFullYear() +
|
|
365
|
+
"-" +
|
|
366
|
+
(month < 10 ? "0" + month : month) +
|
|
367
|
+
"-" +
|
|
368
|
+
date.getDate() +
|
|
369
|
+
" " +
|
|
370
|
+
(date.getHours() + 1) +
|
|
371
|
+
":" +
|
|
372
|
+
date.getMinutes() +
|
|
373
|
+
":" +
|
|
374
|
+
date.getSeconds() +
|
|
375
|
+
'", method: "' +
|
|
376
|
+
req.method +
|
|
377
|
+
'", url: "' +
|
|
378
|
+
req.url +
|
|
379
|
+
'", ip: "' +
|
|
380
|
+
ip +
|
|
381
|
+
'" }'
|
|
382
|
+
);
|
|
349
383
|
}
|
|
350
384
|
}
|
|
351
385
|
|