alado 1.2.4 → 1.2.5
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/alado-server/alado-server.d.ts +6 -2
- package/dist/alado-server/alado-server.js +6 -2
- package/dist/alado-server/alado-server.js.map +1 -1
- package/dist/constants/http-server.d.ts +2 -0
- package/dist/constants/http-server.js +6 -0
- package/dist/constants/http-server.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/options/alado-server-options.d.ts +2 -0
- package/package.json +3 -3
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Server } from 'http';
|
|
1
3
|
import { AladoServerOptions } from '../options';
|
|
2
4
|
import { Context, Response } from '../dto';
|
|
3
5
|
export declare class AladoServer {
|
|
@@ -5,6 +7,8 @@ export declare class AladoServer {
|
|
|
5
7
|
private readonly server;
|
|
6
8
|
private readonly openApiDocObject;
|
|
7
9
|
private port;
|
|
10
|
+
private host;
|
|
11
|
+
private backlog;
|
|
8
12
|
private readonly logger?;
|
|
9
13
|
constructor(options: AladoServerOptions);
|
|
10
14
|
get(path: string, context: Context<any>, handler: (request: any) => Response<any> | Promise<Response<any>>): void;
|
|
@@ -13,6 +17,6 @@ export declare class AladoServer {
|
|
|
13
17
|
patch(path: string, context: Context<any>, handler: (request: any) => Response<any> | Promise<Response<any>>): void;
|
|
14
18
|
delete(path: string, context: Context<any>, handler: (request: any) => Response<any> | Promise<Response<any>>): void;
|
|
15
19
|
head(path: string, context: Context<any>, handler: (request: any) => Promise<Response<any>>): void;
|
|
16
|
-
start(cb
|
|
17
|
-
stop(cb: (error?: Error) => void):
|
|
20
|
+
start(cb?: (err?: Error) => void): Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
21
|
+
stop(cb: (error?: Error) => void): Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
18
22
|
}
|
|
@@ -10,6 +10,8 @@ class AladoServer {
|
|
|
10
10
|
server;
|
|
11
11
|
openApiDocObject;
|
|
12
12
|
port;
|
|
13
|
+
host;
|
|
14
|
+
backlog;
|
|
13
15
|
logger;
|
|
14
16
|
constructor(options) {
|
|
15
17
|
(0, _helper_1.validateAladoOptions)(options);
|
|
@@ -30,6 +32,8 @@ class AladoServer {
|
|
|
30
32
|
logger: this.logger,
|
|
31
33
|
}, this.openApiDocObject);
|
|
32
34
|
this.port = options.port;
|
|
35
|
+
this.host = options.host || _const_1.defaultHost;
|
|
36
|
+
this.backlog = options.backlog || _const_1.defaultBacklog;
|
|
33
37
|
this.server = (0, _factory_1.httpServerFactory)({
|
|
34
38
|
router: this.router,
|
|
35
39
|
openApiDoc: options.openApiDoc,
|
|
@@ -56,10 +60,10 @@ class AladoServer {
|
|
|
56
60
|
this.router.use(_const_1.HttpMethod.HEAD, path, context, handler);
|
|
57
61
|
}
|
|
58
62
|
start(cb) {
|
|
59
|
-
this.server.listen(this.port, cb);
|
|
63
|
+
return this.server.listen(this.port, this.host, this.backlog, cb);
|
|
60
64
|
}
|
|
61
65
|
stop(cb) {
|
|
62
|
-
this.server.close(cb);
|
|
66
|
+
return this.server.close(cb);
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
69
|
exports.AladoServer = AladoServer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alado-server.js","sourceRoot":"","sources":["../../src/alado-server/alado-server.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"alado-server.js","sourceRoot":"","sources":["../../src/alado-server/alado-server.ts"],"names":[],"mappings":";;;AAEA,mCAA0F;AAG1F,qCAAiC;AACjC,uCAA6C;AAC7C,qCAA2D;AAE3D,MAAa,WAAW;IACL,MAAM,CAAS;IACf,MAAM,CAAS;IACf,gBAAgB,CAAM;IAC/B,IAAI,CAAS;IACb,IAAI,CAAS;IACb,OAAO,CAAS;IACP,MAAM,CAA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CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,CAAC,EAA2B;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF;AA/ED,kCA+EC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../../src/constants/http-server.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAW,SAAS,CAAC;AAChC,QAAA,cAAc,GAAW,IAAI,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./content-type"), exports);
|
|
18
18
|
__exportStar(require("./default-doc-object"), exports);
|
|
19
19
|
__exportStar(require("./http-method"), exports);
|
|
20
|
+
__exportStar(require("./http-server"), exports);
|
|
20
21
|
__exportStar(require("./http-status"), exports);
|
|
21
22
|
__exportStar(require("./reg-exp"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,gDAA8B;AAC9B,gDAA8B;AAC9B,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B;AAC9B,4CAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alado",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Extremely fast, lightweight, robust framework for HTTP applications written in Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"HTTP",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"url": "https://github.com/databikers/alado/issues"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://github.com/databikers/alado",
|
|
53
|
-
"engines"
|
|
54
|
-
"node"
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=16.0.0"
|
|
55
55
|
}
|
|
56
56
|
}
|