godprotocol 1.0.75 → 1.0.751
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/package.json +1 -1
- package/utils/create_server.js +4 -4
package/package.json
CHANGED
package/utils/create_server.js
CHANGED
|
@@ -7,7 +7,7 @@ let PORT = 1901,
|
|
|
7
7
|
const cb = (res, data) => {
|
|
8
8
|
if (typeof data !== "string") data = JSON.stringify(data);
|
|
9
9
|
|
|
10
|
-
res
|
|
10
|
+
res(data);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const create_server = async (initiator, serve) => {
|
|
@@ -43,11 +43,11 @@ const create_server = async (initiator, serve) => {
|
|
|
43
43
|
let account = initiator.create_account(data.name, data.server);
|
|
44
44
|
res.end(account.stringify(true));
|
|
45
45
|
} else if (req.url === "/load") {
|
|
46
|
-
initiator.load(data, (datagram) => cb(res, datagram));
|
|
46
|
+
initiator.load(data, (datagram) => cb(res.end, datagram));
|
|
47
47
|
} else if (req.url === "/parse") {
|
|
48
|
-
initiator.parse(data, (datagram) => cb(res, datagram));
|
|
48
|
+
initiator.parse(data, (datagram) => cb(res.end, datagram));
|
|
49
49
|
} else if (req.url === "/run") {
|
|
50
|
-
initiator.run(data, (datagram) => cb(res, datagram));
|
|
50
|
+
initiator.run(data, (datagram) => cb(res.end, datagram));
|
|
51
51
|
}
|
|
52
52
|
if (serve && req.headers.host !== `${serve.domain}:${serve.port}`)
|
|
53
53
|
console.log(`services:${req.url}`);
|