@wxn0brp/gloves-link-server 0.1.0-beta.1 → 0.1.0
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/dist/http.d.ts +2 -2
- package/dist/http.js +3 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/http.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Router } from "@wxn0brp/falcon-frame";
|
|
2
|
-
import { SocketStatus } from "./types.js";
|
|
3
2
|
import { GlovesLinkServer } from "./index.js";
|
|
3
|
+
import { SocketStatus } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Saves the status of a socket connection for temporary tracking
|
|
6
6
|
*/
|
|
@@ -9,7 +9,7 @@ export declare function saveSocketStatus(wss: GlovesLinkServer, socketStatus: So
|
|
|
9
9
|
* Creates a router for handling status requests
|
|
10
10
|
* @returns A router instance for status endpoints
|
|
11
11
|
*/
|
|
12
|
-
export declare function statusRouter(): Router;
|
|
12
|
+
export declare function statusRouter(wss: GlovesLinkServer): Router;
|
|
13
13
|
/**
|
|
14
14
|
* Creates a router for serving client files
|
|
15
15
|
* @param clientDir - Optional directory path for client files, defaults to node_modules/@wxn0brp/gloves-link-client/dist/
|
package/dist/http.js
CHANGED
|
@@ -19,7 +19,7 @@ export function saveSocketStatus(wss, socketStatus) {
|
|
|
19
19
|
* Creates a router for handling status requests
|
|
20
20
|
* @returns A router instance for status endpoints
|
|
21
21
|
*/
|
|
22
|
-
export function statusRouter() {
|
|
22
|
+
export function statusRouter(wss) {
|
|
23
23
|
const router = new Router();
|
|
24
24
|
router.get("/status", (req, res) => {
|
|
25
25
|
const id = req.query.id;
|
|
@@ -33,13 +33,13 @@ export function statusRouter() {
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
const statusKey = path + "-" + id;
|
|
36
|
-
const status =
|
|
36
|
+
const status = wss.initStatusTemp[statusKey];
|
|
37
37
|
if (status === undefined) {
|
|
38
38
|
res.status(404).json({ err: true, msg: "Socket not found" });
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
res.json({ err: false, status });
|
|
42
|
-
delete
|
|
42
|
+
delete wss.initStatusTemp[statusKey];
|
|
43
43
|
});
|
|
44
44
|
return router;
|
|
45
45
|
}
|
package/dist/index.js
CHANGED
|
@@ -162,7 +162,7 @@ export class GlovesLinkServer {
|
|
|
162
162
|
falconFrame(app, clientDir) {
|
|
163
163
|
const router = new Router();
|
|
164
164
|
app.use("/gloves-link", router);
|
|
165
|
-
router.use(statusRouter());
|
|
165
|
+
router.use(statusRouter(this));
|
|
166
166
|
if (clientDir !== false)
|
|
167
167
|
router.use(clientRouter(clientDir));
|
|
168
168
|
}
|