birdpack 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/lib/server.js +14 -1
  2. package/package.json +1 -1
package/lib/server.js CHANGED
@@ -246,7 +246,20 @@ module.exports = class{
246
246
  console.log(out);
247
247
  }
248
248
  traffic(c){
249
- this.log('client',`${c.status} ${c.method} ${c.path} ${c.ip} ${c.get('user-agent')}`);
249
+ this.log('client',`${this.getFormattedDateTime()} ${c.status} ${c.method} ${c.path} ${c.ip} ${c.get('user-agent')}`);
250
+ }
251
+ getFormattedDateTime(){
252
+ let now = new Date();
253
+
254
+ let day = String(now.getDate()).padStart(2, '0');
255
+ let month = String(now.getMonth() + 1).padStart(2, '0');
256
+ let year = now.getFullYear();
257
+
258
+ let hours = String(now.getHours()).padStart(2, '0');
259
+ let minutes = String(now.getMinutes()).padStart(2, '0');
260
+ let seconds = String(now.getSeconds()).padStart(2, '0');
261
+
262
+ return `${day}-${month}-${year} ${hours}:${minutes}:${seconds}`;
250
263
  }
251
264
 
252
265
  powered(){
package/package.json CHANGED
@@ -3,6 +3,6 @@
3
3
  "description": "BirdPack web framework is a tool for web server via TCP HTTP supporting websocket focusing on speed.",
4
4
  "author":"R938",
5
5
  "license":"R938",
6
- "version":"1.0.3",
6
+ "version":"1.0.4",
7
7
  "main": "index.js"
8
8
  }