@expressots/adapter-express 1.2.2 → 1.3.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/lib/CHANGELOG.md +50 -43
- package/lib/cjs/adapter-express/application-express.js +14 -2
- package/lib/cjs/types/adapter-express/application-express.d.ts +7 -0
- package/lib/cjs/types/adapter-express/application-express.interface.d.ts +6 -0
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/lib/CHANGELOG.md
CHANGED
|
@@ -1,59 +1,66 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
## [1.
|
|
3
|
+
## [1.3.0](https://github.com/expressots/adapter-express/compare/1.2.2...1.3.0) (2024-04-26)
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
###
|
|
6
|
+
### Features
|
|
7
7
|
|
|
8
|
+
* returns httpServer for e2e testing with supertest ([97999fb](https://github.com/expressots/adapter-express/commit/97999fbc7ac977e47caf023d7541e588ef50d548))
|
|
9
|
+
|
|
10
|
+
## [1.2.2](https://github.com/expressots/adapter-express/compare/1.2.1...1.2.2) (2024-04-25)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
8
15
|
* validate parameter types in param decorator by default ([b7a8657](https://github.com/expressots/adapter-express/commit/b7a8657598ce51a6fa44c3a388d38106b47ad70d))
|
|
9
16
|
|
|
10
|
-
## [1.2.1](https://github.com/expressots/adapter-express/compare/1.2.0...1.2.1) (2024-04-04)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Code Refactoring
|
|
14
|
-
|
|
15
|
-
* adapter expressto to be used in AppFactory ([239501e](https://github.com/expressots/adapter-express/commit/239501e41bfd98ecc0893a50c34de58dd8914d9e))
|
|
17
|
+
## [1.2.1](https://github.com/expressots/adapter-express/compare/1.2.0...1.2.1) (2024-04-04)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Code Refactoring
|
|
21
|
+
|
|
22
|
+
* adapter expressto to be used in AppFactory ([239501e](https://github.com/expressots/adapter-express/commit/239501e41bfd98ecc0893a50c34de58dd8914d9e))
|
|
16
23
|
* rename items for standardization and improve doc ([2e691d5](https://github.com/expressots/adapter-express/commit/2e691d50731e8d4d689fe4b4420daab8ba2f5803))
|
|
17
24
|
|
|
18
|
-
## [1.2.0](https://github.com/expressots/adapter-express/compare/1.1.1...1.2.0) (2024-3-5)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Features
|
|
22
|
-
|
|
23
|
-
* add expressots middleware support ([809f148](https://github.com/expressots/adapter-express/commit/809f148a2b9a6bb0aa41f231595b3a4c394574ee))
|
|
24
|
-
* bump @commitlint/cli from 17.8.1 to 18.0.0 ([15fbb1a](https://github.com/expressots/adapter-express/commit/15fbb1a84c758df25b60f2a893fd44829db3c0dc))
|
|
25
|
-
* fix middleware binding to constructor ([3a6f7dc](https://github.com/expressots/adapter-express/commit/3a6f7dca40889133b09630582c775156392c4fd7))
|
|
25
|
+
## [1.2.0](https://github.com/expressots/adapter-express/compare/1.1.1...1.2.0) (2024-3-5)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* add expressots middleware support ([809f148](https://github.com/expressots/adapter-express/commit/809f148a2b9a6bb0aa41f231595b3a4c394574ee))
|
|
31
|
+
* bump @commitlint/cli from 17.8.1 to 18.0.0 ([15fbb1a](https://github.com/expressots/adapter-express/commit/15fbb1a84c758df25b60f2a893fd44829db3c0dc))
|
|
32
|
+
* fix middleware binding to constructor ([3a6f7dc](https://github.com/expressots/adapter-express/commit/3a6f7dca40889133b09630582c775156392c4fd7))
|
|
26
33
|
* fix path call on expresso middleware ([934ae17](https://github.com/expressots/adapter-express/commit/934ae17110489315536e28b71cde24f5f18d88dc))
|
|
27
34
|
|
|
28
|
-
## [1.1.1](https://github.com/expressots/adapter-express/compare/1.1.0...1.1.1) (2023-10-10)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
### Bug Fixes
|
|
32
|
-
|
|
33
|
-
* add global prefix on opinionated ([d9d5a06](https://github.com/expressots/adapter-express/commit/d9d5a0669241ed14541a1452aa0deaa12c1109b4))
|
|
34
|
-
* add global route prefix for both templates ([046fd2c](https://github.com/expressots/adapter-express/commit/046fd2c2e2c5beacf9602f929b223713d48e8b9c))
|
|
35
|
-
* adjust build pipeline ([4f164a2](https://github.com/expressots/adapter-express/commit/4f164a2f6ee5c23512a8e6643b90a74891ec52c4))
|
|
36
|
-
* adjust build script and remove esm build option ([b35af7b](https://github.com/expressots/adapter-express/commit/b35af7b9ea91935572920314eddc8f5258bca4bc))
|
|
35
|
+
## [1.1.1](https://github.com/expressots/adapter-express/compare/1.1.0...1.1.1) (2023-10-10)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* add global prefix on opinionated ([d9d5a06](https://github.com/expressots/adapter-express/commit/d9d5a0669241ed14541a1452aa0deaa12c1109b4))
|
|
41
|
+
* add global route prefix for both templates ([046fd2c](https://github.com/expressots/adapter-express/commit/046fd2c2e2c5beacf9602f929b223713d48e8b9c))
|
|
42
|
+
* adjust build pipeline ([4f164a2](https://github.com/expressots/adapter-express/commit/4f164a2f6ee5c23512a8e6643b90a74891ec52c4))
|
|
43
|
+
* adjust build script and remove esm build option ([b35af7b](https://github.com/expressots/adapter-express/commit/b35af7b9ea91935572920314eddc8f5258bca4bc))
|
|
37
44
|
* path in codeql analysis report ([035aa16](https://github.com/expressots/adapter-express/commit/035aa16a9d62de8d7e2b39bae052d8d5499799da))
|
|
38
45
|
|
|
39
|
-
## 1.1.0 (2023-09-21)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### Features
|
|
43
|
-
|
|
44
|
-
* add express as an adapter ([2870790](https://github.com/expressots/adapter-express/commit/28707900882422d0f882e5e18c9bf01457e5640d))
|
|
45
|
-
* add expressjs adapter ([263d12d](https://github.com/expressots/adapter-express/commit/263d12dce314cc4125a0f5b14eaa0b5e171f165f))
|
|
46
|
-
* add peer dependency @expressots/core ([7e8ec24](https://github.com/expressots/adapter-express/commit/7e8ec240fe5caf72a0c371ba317c0d0f52898571))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### Bug Fixes
|
|
50
|
-
|
|
51
|
-
* add dev 0 package version ([748b62a](https://github.com/expressots/adapter-express/commit/748b62ad101ed6efe4454f9a9f0d684f1118dec6))
|
|
52
|
-
* add dev version ([31baee3](https://github.com/expressots/adapter-express/commit/31baee3e7dd578e14fbc6e1e11eb88ae939e1d28))
|
|
53
|
-
* consume new middlewareConfig base ([bed7b4a](https://github.com/expressots/adapter-express/commit/bed7b4ae682a8c8d55c705e5d2f9b40b136e2af1))
|
|
54
|
-
* expose controller interface ([468818f](https://github.com/expressots/adapter-express/commit/468818fec78e06392cb6024cb4b257edebfd8d38))
|
|
55
|
-
* signature to [@core-v2](https://github.com/core-v2).2 ([4fb5c58](https://github.com/expressots/adapter-express/commit/4fb5c58aa4f011c3aa97803ebc8a80ae72d5b56d))
|
|
56
|
-
* update [@core](https://github.com/core) dependency to altest ([0138609](https://github.com/expressots/adapter-express/commit/01386093f6116e4731270fd17a1250b564387c56))
|
|
46
|
+
## 1.1.0 (2023-09-21)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
* add express as an adapter ([2870790](https://github.com/expressots/adapter-express/commit/28707900882422d0f882e5e18c9bf01457e5640d))
|
|
52
|
+
* add expressjs adapter ([263d12d](https://github.com/expressots/adapter-express/commit/263d12dce314cc4125a0f5b14eaa0b5e171f165f))
|
|
53
|
+
* add peer dependency @expressots/core ([7e8ec24](https://github.com/expressots/adapter-express/commit/7e8ec240fe5caf72a0c371ba317c0d0f52898571))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Bug Fixes
|
|
57
|
+
|
|
58
|
+
* add dev 0 package version ([748b62a](https://github.com/expressots/adapter-express/commit/748b62ad101ed6efe4454f9a9f0d684f1118dec6))
|
|
59
|
+
* add dev version ([31baee3](https://github.com/expressots/adapter-express/commit/31baee3e7dd578e14fbc6e1e11eb88ae939e1d28))
|
|
60
|
+
* consume new middlewareConfig base ([bed7b4a](https://github.com/expressots/adapter-express/commit/bed7b4ae682a8c8d55c705e5d2f9b40b136e2af1))
|
|
61
|
+
* expose controller interface ([468818f](https://github.com/expressots/adapter-express/commit/468818fec78e06392cb6024cb4b257edebfd8d38))
|
|
62
|
+
* signature to [@core-v2](https://github.com/core-v2).2 ([4fb5c58](https://github.com/expressots/adapter-express/commit/4fb5c58aa4f011c3aa97803ebc8a80ae72d5b56d))
|
|
63
|
+
* update [@core](https://github.com/core) dependency to altest ([0138609](https://github.com/expressots/adapter-express/commit/01386093f6116e4731270fd17a1250b564387c56))
|
|
57
64
|
* update peer dependecy for [@core](https://github.com/core) ([16a01f3](https://github.com/expressots/adapter-express/commit/16a01f353f3285a68a2038ceb40b6498c64c5a34))
|
|
58
65
|
|
|
59
66
|
## 0.0.1 (2023-09-05)
|
|
@@ -14,8 +14,8 @@ const core_1 = require("@expressots/core");
|
|
|
14
14
|
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
15
15
|
const process_1 = __importDefault(require("process"));
|
|
16
16
|
const application_express_base_1 = require("./application-express.base");
|
|
17
|
-
const inversify_express_server_1 = require("./express-utils/inversify-express-server");
|
|
18
17
|
const application_express_types_1 = require("./application-express.types");
|
|
18
|
+
const inversify_express_server_1 = require("./express-utils/inversify-express-server");
|
|
19
19
|
/**
|
|
20
20
|
* The AppExpress class provides methods for configuring and running an Express application.
|
|
21
21
|
* @class AppExpress
|
|
@@ -30,6 +30,7 @@ const application_express_types_1 = require("./application-express.types");
|
|
|
30
30
|
let AppExpress = class AppExpress extends application_express_base_1.ApplicationBase {
|
|
31
31
|
constructor() {
|
|
32
32
|
super(...arguments);
|
|
33
|
+
this.logger = new core_1.Logger();
|
|
33
34
|
this.globalPrefix = "/";
|
|
34
35
|
this.middlewares = [];
|
|
35
36
|
}
|
|
@@ -118,7 +119,7 @@ let AppExpress = class AppExpress extends application_express_base_1.Application
|
|
|
118
119
|
*/
|
|
119
120
|
async listen(port, environment, consoleMessage) {
|
|
120
121
|
await this.init();
|
|
121
|
-
this.port = port;
|
|
122
|
+
this.port = port || 3000;
|
|
122
123
|
this.environment = environment;
|
|
123
124
|
this.app.set("env", environment);
|
|
124
125
|
this.app.listen(this.port, () => {
|
|
@@ -174,6 +175,17 @@ let AppExpress = class AppExpress extends application_express_base_1.Application
|
|
|
174
175
|
.error("isDevelopment() method must be called on `PostServerInitialization`", "application");
|
|
175
176
|
return false;
|
|
176
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Get the underlying HTTP server. (default: Express.js)
|
|
180
|
+
* @returns The underlying HTTP server after initialization.
|
|
181
|
+
*/
|
|
182
|
+
async getHttpServer() {
|
|
183
|
+
if (!this.app) {
|
|
184
|
+
this.logger.error("The method can only be called in `app.provider` or in e2e tests with supertest.", "adapter-express");
|
|
185
|
+
throw new Error("Incorrect usage of `getHttpServer` method");
|
|
186
|
+
}
|
|
187
|
+
return this.app;
|
|
188
|
+
}
|
|
177
189
|
};
|
|
178
190
|
exports.AppExpress = AppExpress;
|
|
179
191
|
exports.AppExpress = AppExpress = __decorate([
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IApplicationMessageToConsole, RenderTemplateOptions } from "@expressots/core";
|
|
2
|
+
import express from "express";
|
|
2
3
|
import { Container } from "inversify";
|
|
3
4
|
import { ApplicationBase } from "./application-express.base";
|
|
4
5
|
import { IWebServer, ServerEnvironment } from "./application-express.types";
|
|
@@ -14,6 +15,7 @@ import { IWebServer, ServerEnvironment } from "./application-express.types";
|
|
|
14
15
|
* @method isDevelopment - Verifies if the current environment is development.
|
|
15
16
|
*/
|
|
16
17
|
declare class AppExpress extends ApplicationBase implements IWebServer {
|
|
18
|
+
private logger;
|
|
17
19
|
private app;
|
|
18
20
|
private port;
|
|
19
21
|
private environment;
|
|
@@ -81,5 +83,10 @@ declare class AppExpress extends ApplicationBase implements IWebServer {
|
|
|
81
83
|
* @returns A boolean value indicating whether the current environment is development or not.
|
|
82
84
|
*/
|
|
83
85
|
protected isDevelopment(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Get the underlying HTTP server. (default: Express.js)
|
|
88
|
+
* @returns The underlying HTTP server after initialization.
|
|
89
|
+
*/
|
|
90
|
+
getHttpServer(): Promise<express.Application>;
|
|
84
91
|
}
|
|
85
92
|
export { AppExpress };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import express from "express";
|
|
1
2
|
import { IApplicationMessageToConsole, RenderTemplateOptions } from "@expressots/core";
|
|
2
3
|
import { ServerEnvironment } from "./application-express.types";
|
|
3
4
|
/**
|
|
@@ -23,4 +24,9 @@ export interface IWebServerPublic {
|
|
|
23
24
|
* This includes the extension name, view path, and the engine function itself.
|
|
24
25
|
*/
|
|
25
26
|
setEngine<T extends RenderTemplateOptions>(options: T): void;
|
|
27
|
+
/**
|
|
28
|
+
* Get the underlying HTTP server. (default: Express.js)
|
|
29
|
+
* @returns The underlying HTTP server after initialization.
|
|
30
|
+
*/
|
|
31
|
+
getHttpServer(): Promise<express.Application>;
|
|
26
32
|
}
|
package/lib/package.json
CHANGED