tinny-backend 1.0.5 → 1.0.7
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/core/Server.d.ts +2 -0
- package/dist/core/Server.js +6 -0
- package/dist/core/types.d.ts +1 -0
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.js +1 -1
- package/package.json +1 -1
- package/dist/tester.d.ts +0 -1
- package/dist/tester.js +0 -10
package/dist/core/Server.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ServerOptions, ServerRes, Handlers, AddOption, HandlerFun, Decorator, Logs, DirFiles } from "./types.js";
|
|
2
|
+
import * as http from "http";
|
|
2
3
|
export default class Server {
|
|
3
4
|
private PORT;
|
|
4
5
|
private hostname;
|
|
@@ -12,6 +13,7 @@ export default class Server {
|
|
|
12
13
|
private ServerName;
|
|
13
14
|
private defaultHandler;
|
|
14
15
|
getMethodHandlers(): Handlers[];
|
|
16
|
+
getHttpServer(): http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
|
|
15
17
|
getDecorators(): Decorator[];
|
|
16
18
|
getUpTime(): number;
|
|
17
19
|
getReqCount(): number;
|
package/dist/core/Server.js
CHANGED
|
@@ -23,6 +23,9 @@ export default class Server {
|
|
|
23
23
|
getMethodHandlers() {
|
|
24
24
|
return this.methodHandler;
|
|
25
25
|
}
|
|
26
|
+
getHttpServer() {
|
|
27
|
+
return this.server;
|
|
28
|
+
}
|
|
26
29
|
getDecorators() {
|
|
27
30
|
return this.decorators;
|
|
28
31
|
}
|
|
@@ -219,13 +222,16 @@ export default class Server {
|
|
|
219
222
|
});
|
|
220
223
|
this.server = http.createServer((req, res) => {
|
|
221
224
|
let body = "";
|
|
225
|
+
const rawChunks = [];
|
|
222
226
|
this.reqCount++;
|
|
223
227
|
const Req = RequestParser(req, this);
|
|
224
228
|
const Res = ResponseParser(res, Req, this);
|
|
225
229
|
req.on("data", (chunk) => {
|
|
226
230
|
body += chunk.toString();
|
|
231
|
+
rawChunks.push(chunk);
|
|
227
232
|
});
|
|
228
233
|
req.on("end", async () => {
|
|
234
|
+
Req.RawBody = Buffer.concat(rawChunks);
|
|
229
235
|
if (req.headers["content-type"] === "application/json") {
|
|
230
236
|
Req.body = body ? JSON.parse(body) : null;
|
|
231
237
|
}
|
package/dist/core/types.d.ts
CHANGED
package/dist/utils/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.
|
|
1
|
+
export declare const VERSION = "1.0.7";
|
package/dist/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.0.
|
|
1
|
+
export const VERSION = "1.0.7";
|
package/package.json
CHANGED
package/dist/tester.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|