vanilla-jet 1.1.3 → 1.1.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/framework/server.js +15 -13
  2. package/package.json +9 -9
@@ -54,7 +54,7 @@ class Server {
54
54
  global.dipper = new Dipper(opts, shared);
55
55
 
56
56
  // -- Create the server
57
- obj.httpx = obj.createServer(obj.options, obj.security);
57
+ obj.createServer();
58
58
 
59
59
  // -- Not found callback
60
60
  obj.onNotFound = opts.onNotFound;
@@ -87,32 +87,34 @@ class Server {
87
87
  obj.log('-----------------------------------------------------------------');
88
88
  }
89
89
 
90
- createServer(options, security) {
90
+ createServer() {
91
91
 
92
92
  let obj = this;
93
93
  // -- Http server
94
- let isHttp = /^((http):\/\/)/.test(options.site_url) || /^((localhost))/.test(options.site_url);
95
- if (isHttp) {
96
- return http.createServer((req, res) => {
97
- obj.router.onRequest(obj.router, req, res);
94
+ let isLocalhost = /^((http):\/\/)/.test(obj.options.site_url) || /^((localhost))/.test(obj.options.site_url);
95
+ if (isLocalhost) {
96
+ obj.httpx = http.createServer((req, res) => {
97
+ obj.router.onRequest.call(obj.router, req, res);
98
98
  });
99
+ return;
99
100
  }
100
101
 
101
102
  // -- Https server (self managed certs)
102
- if (security.self_managed_certs) {
103
+ if (obj.security.self_managed_certs) {
103
104
  let certs = {
104
- key: fs.readFileSync(security.key, 'utf8'),
105
- cert: fs.readFileSync(security.cert, 'utf8'),
105
+ key: fs.readFileSync(obj.security.key, 'utf8'),
106
+ cert: fs.readFileSync(obj.security.cert, 'utf8'),
106
107
  allowHTTP1: true
107
108
  };
108
- return http2.createSecureServer(certs, (req, res) => {
109
- obj.router.onRequest(obj.router, req, res);
109
+ obj.httpx = http2.createSecureServer(certs, (req, res) => {
110
+ obj.router.onRequest.call(obj.router, req, res);
110
111
  });
112
+ return;
111
113
  }
112
114
 
113
115
  // -- Certs managed by NGINX, Google Cloud Run, etc.
114
- return http2.createServer({ allowHTTP1: true }, (req, res) => {
115
- obj.router.onRequest(obj.router, req, res);
116
+ obj.httpx = http2.createServer({ allowHTTP1: true }, (req, res) => {
117
+ obj.router.onRequest.call(obj.router, req, res);
116
118
  });
117
119
  }
118
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-jet",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "VannilaJet framework",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -29,26 +29,26 @@
29
29
  },
30
30
  "homepage": "https://github.com/nalancer08/VanillaJet#readme",
31
31
  "dependencies": {
32
- "blueimp-md5": "2.8.0",
32
+ "blueimp-md5": "2.19.0",
33
33
  "chalk": "4.1.2",
34
34
  "grunt": "1.6.1",
35
- "grunt-cli": "1.4.3",
35
+ "grunt-cli": "1.5.0",
36
36
  "grunt-contrib-clean": "2.0.1",
37
37
  "grunt-contrib-compress": "2.0.0",
38
38
  "grunt-contrib-concat": "2.1.0",
39
39
  "grunt-contrib-cssmin": "5.0.0",
40
40
  "grunt-contrib-less": "3.0.0",
41
- "grunt-contrib-uglify": "5.0.1",
41
+ "grunt-contrib-uglify": "5.2.2",
42
42
  "grunt-contrib-watch": "1.1.0",
43
43
  "grunt-run": "0.8.1",
44
44
  "grunt-shell": "4.0.0",
45
45
  "html-minifier-terser": "7.2.0",
46
46
  "jit-grunt": "0.10.0",
47
- "js-beautify": "1.14.8",
48
- "jsrsasign": "11.0.0",
49
- "jwt-simple": "0.5.3",
50
- "minimist": "1.2.6",
51
- "nodemon": "3.0.1",
47
+ "js-beautify": "1.15.4",
48
+ "jsrsasign": "11.1.0",
49
+ "jwt-simple": "0.5.6",
50
+ "minimist": "1.2.8",
51
+ "nodemon": "3.1.10",
52
52
  "nunjucks": "3.2.4",
53
53
  "underscore": ">= 1.12.x",
54
54
  "zlib": "1.0.5"