godprotocol 2.3.17 → 2.3.19
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 +5 -0
- package/package.json +1 -1
- package/server/Routable/Services.js +10 -3
- package/server/version_control.js +4 -0
package/Godprotocol.js
CHANGED
|
@@ -5,6 +5,7 @@ import version_middleware from "./server/version_control.js";
|
|
|
5
5
|
class GodProtocol {
|
|
6
6
|
constructor(config) {
|
|
7
7
|
this.db_config = config.db_config;
|
|
8
|
+
this.server = config.server;
|
|
8
9
|
|
|
9
10
|
this.resource = new Resource(this);
|
|
10
11
|
|
|
@@ -42,6 +43,10 @@ class GodProtocol {
|
|
|
42
43
|
return await this.route_table.platform_db();
|
|
43
44
|
};
|
|
44
45
|
|
|
46
|
+
version_db = async (version) => {
|
|
47
|
+
return await this.route_table.version_db(version);
|
|
48
|
+
};
|
|
49
|
+
|
|
45
50
|
load_services = async (services) => {
|
|
46
51
|
await this.route_table.load_services(services);
|
|
47
52
|
};
|
package/package.json
CHANGED
|
@@ -153,9 +153,16 @@ class Services {
|
|
|
153
153
|
};
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
let
|
|
158
|
-
|
|
156
|
+
version_db = async (ver) => {
|
|
157
|
+
let version = await this.get_version(ver);
|
|
158
|
+
if (!version) return;
|
|
159
|
+
|
|
160
|
+
return await this.platform_db();
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
platform_db = async (name) => {
|
|
164
|
+
let prefix = this.db_prefix;
|
|
165
|
+
name = name || this.db_name || this.db_config.name;
|
|
159
166
|
|
|
160
167
|
if (prefix) {
|
|
161
168
|
name = `${prefix}:${name}`;
|