godprotocol 2.2.96 → 2.2.98
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/Godprotocol.js +8 -6
- package/package.json +1 -1
- package/server/version_control.js +2 -2
package/Godprotocol.js
CHANGED
|
@@ -14,15 +14,17 @@ class GodProtocol {
|
|
|
14
14
|
this.route_table = new Route_table(this);
|
|
15
15
|
|
|
16
16
|
this.memory = new Map();
|
|
17
|
-
|
|
18
|
-
if (typeof this.startup_fn === "function") {
|
|
19
|
-
this.startup_fn(this);
|
|
20
|
-
}
|
|
21
17
|
}
|
|
22
18
|
|
|
23
|
-
on_start
|
|
19
|
+
on_start(fn) {
|
|
24
20
|
this.startup_fn = fn;
|
|
25
|
-
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async boot() {
|
|
24
|
+
if (this.startup_fn) {
|
|
25
|
+
await this.startup_fn(this);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
26
28
|
|
|
27
29
|
uri_default_domain = (uri) => {
|
|
28
30
|
if (!uri.includes(".")) {
|
package/package.json
CHANGED
|
@@ -83,7 +83,7 @@ const respond = (result, res) => {
|
|
|
83
83
|
|
|
84
84
|
res.end(JSON.stringify(response));
|
|
85
85
|
|
|
86
|
-
res.gp
|
|
86
|
+
res.gp?.resource?.compute_response(res);
|
|
87
87
|
|
|
88
88
|
return response;
|
|
89
89
|
};
|
|
@@ -103,7 +103,7 @@ const version_middleware = async (req, res, routers) => {
|
|
|
103
103
|
const pathname = parsed_url.pathname;
|
|
104
104
|
|
|
105
105
|
req.request_id = crypto.randomUUID();
|
|
106
|
-
routers.gp
|
|
106
|
+
routers.gp?.resource?.incoming_request(req);
|
|
107
107
|
res.gp = routers.gp;
|
|
108
108
|
res.request_id = req.request_id;
|
|
109
109
|
|