@nestjs/platform-express 12.0.0-alpha.1 → 12.0.0-alpha.3
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
|
@@ -29,7 +29,7 @@ Nest is a framework for building efficient, scalable <a href="https://nodejs.org
|
|
|
29
29
|
|
|
30
30
|
## Philosophy
|
|
31
31
|
|
|
32
|
-
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front and
|
|
32
|
+
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front-end and back-end applications, giving rise to awesome projects like <a href="https://angular.dev/" target="_blank">Angular</a>, <a href="https://react.dev/" target="_blank">React</a>, and <a href="https://vuejs.org/" target="_blank">Vue</a>, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.</p>
|
|
33
33
|
<p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, and loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.</p>
|
|
34
34
|
|
|
35
35
|
## Getting started
|
|
@@ -95,6 +95,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
95
95
|
<td align="center" valign="middle"><a href="https://crawljobs.com" target="_blank"><img src="https://nestjs.com/img/logos/crawljobs-logo.svg" width="130" valign="middle" /></a></td>
|
|
96
96
|
</tr><tr>
|
|
97
97
|
<td align="center" valign="middle"><a href="https://pandektes.com" target="_blank"><img src="https://nestjs.com/img/logos/pandektes-logo.png" width="65" valign="middle" /></a></td>
|
|
98
|
+
<td align="center" valign="middle"><a href="https://www.fintechcrafts.com/" target="_blank"><img src="https://nestjs.com/img/logos/fintechcrafts-logo.svg" width="65" valign="middle" /></a></td>
|
|
98
99
|
</tr>
|
|
99
100
|
</table>
|
|
100
101
|
|
|
@@ -49,19 +49,7 @@ export class ExpressAdapter extends AbstractHttpAdapter {
|
|
|
49
49
|
return response.send();
|
|
50
50
|
}
|
|
51
51
|
if (body instanceof StreamableFile) {
|
|
52
|
-
|
|
53
|
-
if (response.getHeader('Content-Type') === undefined &&
|
|
54
|
-
streamHeaders.type !== undefined) {
|
|
55
|
-
response.setHeader('Content-Type', streamHeaders.type);
|
|
56
|
-
}
|
|
57
|
-
if (response.getHeader('Content-Disposition') === undefined &&
|
|
58
|
-
streamHeaders.disposition !== undefined) {
|
|
59
|
-
response.setHeader('Content-Disposition', streamHeaders.disposition);
|
|
60
|
-
}
|
|
61
|
-
if (response.getHeader('Content-Length') === undefined &&
|
|
62
|
-
streamHeaders.length !== undefined) {
|
|
63
|
-
response.setHeader('Content-Length', streamHeaders.length);
|
|
64
|
-
}
|
|
52
|
+
this.applyStreamHeaders(response, body);
|
|
65
53
|
const stream = body.getStream();
|
|
66
54
|
stream.once('error', err => {
|
|
67
55
|
body.errorHandler(err, response);
|
|
@@ -399,4 +387,16 @@ export class ExpressAdapter extends AbstractHttpAdapter {
|
|
|
399
387
|
isFunction(app.router.stack.filter) &&
|
|
400
388
|
app.router.stack.some((layer) => layer && layer.handle && layer.handle.name === name));
|
|
401
389
|
}
|
|
390
|
+
setHeaderIfNotExists(response, name, value) {
|
|
391
|
+
if (value !== undefined && response.getHeader(name) === undefined) {
|
|
392
|
+
const headerValue = Array.isArray(value) ? value.join(',') : value;
|
|
393
|
+
response.setHeader(name, headerValue);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
applyStreamHeaders(response, streamable) {
|
|
397
|
+
const headers = streamable.getHeaders();
|
|
398
|
+
this.setHeaderIfNotExists(response, 'Content-Type', headers.type);
|
|
399
|
+
this.setHeaderIfNotExists(response, 'Content-Disposition', headers.disposition);
|
|
400
|
+
this.setHeaderIfNotExists(response, 'Content-Length', headers.length);
|
|
401
|
+
}
|
|
402
402
|
}
|
|
@@ -29,6 +29,8 @@ export interface MulterOptions {
|
|
|
29
29
|
};
|
|
30
30
|
/** Keep the full path of files instead of just the base name (Default: false) */
|
|
31
31
|
preservePath?: boolean;
|
|
32
|
+
/** Default character set for part header values (e.g. filename) (Default: 'latin1') */
|
|
33
|
+
defParamCharset?: string;
|
|
32
34
|
fileFilter?(req: any, file: {
|
|
33
35
|
/** Field name specified in the form */
|
|
34
36
|
fieldname: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/platform-express",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.3",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@platform-express)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,12 +9,7 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./index.js",
|
|
11
11
|
"./*.js": "./*.js",
|
|
12
|
-
"./*": "./*.js"
|
|
13
|
-
"./adapters": "./adapters/index.js",
|
|
14
|
-
"./interfaces": "./interfaces/index.js",
|
|
15
|
-
"./multer": "./multer/index.js",
|
|
16
|
-
"./multer/interceptors": "./multer/interceptors/index.js",
|
|
17
|
-
"./multer/interfaces": "./multer/interfaces/index.js"
|
|
12
|
+
"./*": "./*.js"
|
|
18
13
|
},
|
|
19
14
|
"homepage": "https://nestjs.com",
|
|
20
15
|
"funding": {
|
|
@@ -32,17 +27,17 @@
|
|
|
32
27
|
"dependencies": {
|
|
33
28
|
"cors": "2.8.6",
|
|
34
29
|
"express": "5.2.1",
|
|
35
|
-
"multer": "2.
|
|
36
|
-
"path-to-regexp": "8.
|
|
30
|
+
"multer": "2.1.1",
|
|
31
|
+
"path-to-regexp": "8.4.2",
|
|
37
32
|
"tslib": "2.8.1"
|
|
38
33
|
},
|
|
39
34
|
"devDependencies": {
|
|
40
|
-
"@nestjs/common": "^12.0.0-alpha.
|
|
41
|
-
"@nestjs/core": "^12.0.0-alpha.
|
|
35
|
+
"@nestjs/common": "^12.0.0-alpha.3",
|
|
36
|
+
"@nestjs/core": "^12.0.0-alpha.3"
|
|
42
37
|
},
|
|
43
38
|
"peerDependencies": {
|
|
44
39
|
"@nestjs/common": "^11.0.0",
|
|
45
40
|
"@nestjs/core": "^11.0.0"
|
|
46
41
|
},
|
|
47
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "1c9d5482a65a446ede8dd1195bfa1cbbc16e0857"
|
|
48
43
|
}
|