@nestjs/platform-express 8.0.2 → 8.0.6
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/Readme.md
CHANGED
|
@@ -108,6 +108,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
108
108
|
<td align="center" valign="middle"><a href="https://www.bystored.com/" target="_blank"><img src="https://nestjs.com/img/stored-logo.svg" width="110" valign="middle" /></a></td>
|
|
109
109
|
<td align="center" valign="middle"><a href="https://studyclerk.com/pay-for-research-paper" target="_blank"><img src="https://nestjs.com/img/studyclerk-logo.png" width="125" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://xyndata.com" target="_blank"><img src="https://nestjs.com/img/xyndata-logo.png" width="125" valign="middle" /></a></td></tr><tr>
|
|
110
110
|
<td align="center" valign="middle"><a href="https://www.anonymistic.com/" target="_blank"><img src="https://nestjs.com/img/anonymistic-logo.png" width="125" valign="middle" /></a></td>
|
|
111
|
+
<td align="center" valign="middle"><a href="https://www.naologic.com/" target="_blank"><img src="https://nestjs.com/img/naologic-logo.svg" width="125" valign="middle" /></a></td>
|
|
111
112
|
</tr></table>
|
|
112
113
|
|
|
113
114
|
## Backers
|
|
@@ -4,7 +4,6 @@ import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-applicati
|
|
|
4
4
|
import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
|
|
5
5
|
import { ServeStaticOptions } from '../interfaces/serve-static-options.interface';
|
|
6
6
|
export declare class ExpressAdapter extends AbstractHttpAdapter {
|
|
7
|
-
private readonly routerMethodFactory;
|
|
8
7
|
constructor(instance?: any);
|
|
9
8
|
reply(response: any, body: any, statusCode?: number): any;
|
|
10
9
|
status(response: any, statusCode: number): any;
|
|
@@ -4,7 +4,6 @@ exports.ExpressAdapter = void 0;
|
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
6
6
|
const http_adapter_1 = require("@nestjs/core/adapters/http-adapter");
|
|
7
|
-
const router_method_factory_1 = require("@nestjs/core/helpers/router-method-factory");
|
|
8
7
|
const bodyParser = require("body-parser");
|
|
9
8
|
const cors = require("cors");
|
|
10
9
|
const express = require("express");
|
|
@@ -13,7 +12,6 @@ const https = require("https");
|
|
|
13
12
|
class ExpressAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
14
13
|
constructor(instance) {
|
|
15
14
|
super(instance || express());
|
|
16
|
-
this.routerMethodFactory = new router_method_factory_1.RouterMethodFactory();
|
|
17
15
|
}
|
|
18
16
|
reply(response, body, statusCode) {
|
|
19
17
|
if (statusCode) {
|
|
@@ -23,7 +21,9 @@ class ExpressAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
23
21
|
return response.send();
|
|
24
22
|
}
|
|
25
23
|
if (body instanceof common_1.StreamableFile) {
|
|
26
|
-
response.
|
|
24
|
+
if (response.getHeader('Content-Type') === undefined) {
|
|
25
|
+
response.setHeader('Content-Type', 'application/octet-stream');
|
|
26
|
+
}
|
|
27
27
|
return body.getStream().pipe(response);
|
|
28
28
|
}
|
|
29
29
|
return shared_utils_1.isObject(body) ? response.json(body) : response.send(String(body));
|
|
@@ -92,9 +92,7 @@ class ExpressAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
92
92
|
return this.use(cors(options));
|
|
93
93
|
}
|
|
94
94
|
createMiddlewareFactory(requestMethod) {
|
|
95
|
-
return this.
|
|
96
|
-
.get(this.instance, requestMethod)
|
|
97
|
-
.bind(this.instance);
|
|
95
|
+
return this.instance.use.bind(this.instance);
|
|
98
96
|
}
|
|
99
97
|
initHttpServer(options) {
|
|
100
98
|
const isHttpsEnabled = options && options.httpsOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/platform-express",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.6",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@platform-express)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"tslib": "2.3.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@nestjs/common": "8.0.
|
|
28
|
-
"@nestjs/core": "8.0.
|
|
27
|
+
"@nestjs/common": "8.0.6",
|
|
28
|
+
"@nestjs/core": "8.0.6"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@nestjs/common": "^8.0.0",
|