te.js 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/package.json +1 -1
  2. package/server/ammo.js +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "te.js",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "A nodejs framework",
5
5
  "type": "module",
6
6
  "main": "te.js",
package/server/ammo.js CHANGED
@@ -13,6 +13,14 @@ class Ammo {
13
13
  this.req = req;
14
14
  this.res = res;
15
15
 
16
+ this.GET = false;
17
+ this.POST = false;
18
+ this.PUT = false;
19
+ this.DELETE = false;
20
+ this.PATCH = false;
21
+ this.HEAD = false;
22
+ this.OPTIONS = false;
23
+
16
24
  // Request related data
17
25
  this.ip = undefined;
18
26
  this.headers = undefined;
@@ -33,6 +41,14 @@ class Ammo {
33
41
 
34
42
  async enhance() {
35
43
  await ammoEnhancer(this);
44
+
45
+ this.GET = this.method === 'GET';
46
+ this.POST = this.method === 'POST';
47
+ this.PUT = this.method === 'PUT';
48
+ this.DELETE = this.method === 'DELETE';
49
+ this.PATCH = this.method === 'PATCH';
50
+ this.HEAD = this.method === 'HEAD';
51
+ this.OPTIONS = this.method === 'OPTIONS';
36
52
  }
37
53
 
38
54
  fire() {