express.io.js 1.0.1152 → 1.0.1248
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/node_packages/express.js +3 -1
- package/package.json +2 -2
package/node_packages/express.js
CHANGED
|
@@ -18,7 +18,7 @@ class express {
|
|
|
18
18
|
this.express = $.express ();
|
|
19
19
|
this.config = config;
|
|
20
20
|
this.host = this.config.host || "0.0.0.0";
|
|
21
|
-
this.port =
|
|
21
|
+
this.port = this.config.port || process.env.PORT || 3000;
|
|
22
22
|
this.serve = this.config.static || {dotfiles: "ignore"}
|
|
23
23
|
}
|
|
24
24
|
static (path = "public", option) {
|
|
@@ -43,6 +43,7 @@ class express {
|
|
|
43
43
|
return function (request, response, next) {
|
|
44
44
|
if (app.__.request.error.length) {
|
|
45
45
|
if (app.__.request.error.includes ("forbidden")) app.__.response.error.forbidden ();
|
|
46
|
+
else if (app.__.request.error.includes ("found")) app.__.response.error.found ();
|
|
46
47
|
else app.__.response.error ();
|
|
47
48
|
}
|
|
48
49
|
else context (app.__.request, app.__.response, next, {request, response});
|
|
@@ -114,6 +115,7 @@ express.response = function (app, request, http_d) {
|
|
|
114
115
|
response.output = new $.html ();
|
|
115
116
|
response.error = function (code = 500) { http_d.response.status (code).send (URL.header.status.code [code]); }
|
|
116
117
|
response.error.forbidden = function (code = 403) { http_d.response.status (code).send (URL.header.status.code [code]); }
|
|
118
|
+
response.error.found = function (code = 404) { http_d.response.status (code).send (URL.header.status.code [code]); }
|
|
117
119
|
return response;
|
|
118
120
|
}
|
|
119
121
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express.io.js",
|
|
3
3
|
"description": "Hello World",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1248",
|
|
5
5
|
"author": "Seindi Rahmat Barus <xseindi@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Seindi Rahmat Barus <xseindi@gmail.com>"
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"express": "^5.2.1",
|
|
25
|
-
"script.io.js": "^1.0.
|
|
25
|
+
"script.io.js": "^1.0.1248"
|
|
26
26
|
}
|
|
27
27
|
}
|