You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Die Funktion `res.sendfile()` wurde durch eine Version in Camel-Schreibweise von `res.sendFile()` in Express 5 ersetzt.
327
327
328
+
**Note:** In Express 5, `res.sendFile()` uses the `mime-types` package for MIME type detection, which returns different Content-Type values than Express 4 for several common file types:
329
+
330
+
- JavaScript files (.js): now "text/javascript" instead of "application/javascript"
331
+
- JSON files (.json): now "application/json" instead of "text/json"
332
+
- CSS files (.css): now "text/css" instead of "text/plain"
333
+
- XML files (.xml): now "application/xml" instead of "text/xml"
334
+
- Font files (.woff): now "font/woff" instead of "application/font-woff"
335
+
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"
336
+
328
337
{% include admonitions/note.html content=codemod-deprecated-signatures %}
329
338
330
339
```js
@@ -348,6 +357,15 @@ The `router.param(fn)` signature was used for modifying the behavior of the `rou
348
357
In Express 5, `mime` is no longer an exported property of the `static` field.
349
358
Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work with MIME type values.
350
359
360
+
**Important:** This change affects not only direct usage of `express.static.mime` but also other Express methods that rely on MIME type detection, such as `res.sendFile()`. The following MIME types have changed from Express 4:
361
+
362
+
- JavaScript files (.js): now served as "text/javascript" instead of "application/javascript"
363
+
- JSON files (.json): now served as "application/json" instead of "text/json"
364
+
- CSS files (.css): now served as "text/css" instead of "text/plain"
365
+
- HTML files (.html): now served as "text/html; charset=utf-8" instead of just "text/html"
366
+
- XML files (.xml): now served as "application/xml" instead of "text/xml"
367
+
- Font files (.woff): now served as "font/woff" instead of "application/font-woff"
La función `res.sendfile()` se ha sustituido por una versión de la función `res.sendFile()` con cada palabra en mayúscula en Express 5.
327
327
328
+
**Note:** In Express 5, `res.sendFile()` uses the `mime-types` package for MIME type detection, which returns different Content-Type values than Express 4 for several common file types:
329
+
330
+
- JavaScript files (.js): now "text/javascript" instead of "application/javascript"
331
+
- JSON files (.json): now "application/json" instead of "text/json"
332
+
- CSS files (.css): now "text/css" instead of "text/plain"
333
+
- XML files (.xml): now "application/xml" instead of "text/xml"
334
+
- Font files (.woff): now "font/woff" instead of "application/font-woff"
335
+
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"
336
+
328
337
{% include admonitions/note.html content=codemod-deprecated-signatures %}
329
338
330
339
```js
@@ -348,6 +357,15 @@ The `router.param(fn)` signature was used for modifying the behavior of the `rou
348
357
In Express 5, `mime` is no longer an exported property of the `static` field.
349
358
Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work with MIME type values.
350
359
360
+
**Important:** This change affects not only direct usage of `express.static.mime` but also other Express methods that rely on MIME type detection, such as `res.sendFile()`. The following MIME types have changed from Express 4:
361
+
362
+
- JavaScript files (.js): now served as "text/javascript" instead of "application/javascript"
363
+
- JSON files (.json): now served as "application/json" instead of "text/json"
364
+
- CSS files (.css): now served as "text/css" instead of "text/plain"
365
+
- HTML files (.html): now served as "text/html; charset=utf-8" instead of just "text/html"
366
+
- XML files (.xml): now served as "application/xml" instead of "text/xml"
367
+
- Font files (.woff): now served as "font/woff" instead of "application/font-woff"
@@ -378,6 +378,15 @@ La fonction `res.sendfile()` a été remplacée
378
378
par une
379
379
version CamelCase `res.sendFile()` dans Express 5.
380
380
381
+
**Note:** In Express 5, `res.sendFile()` uses the `mime-types` package for MIME type detection, which returns different Content-Type values than Express 4 for several common file types:
382
+
383
+
- JavaScript files (.js): now "text/javascript" instead of "application/javascript"
384
+
- JSON files (.json): now "application/json" instead of "text/json"
385
+
- CSS files (.css): now "text/css" instead of "text/plain"
386
+
- XML files (.xml): now "application/xml" instead of "text/xml"
387
+
- Font files (.woff): now "font/woff" instead of "application/font-woff"
388
+
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"
389
+
381
390
{% include admonitions/note.html content=codemod-deprecated-signatures %}
382
391
383
392
```js
@@ -402,6 +411,15 @@ version 4.11.0 et Express 5 ne la prend plus en charge.
402
411
In Express 5, `mime` is no longer an exported property of the `static` field.
403
412
Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work with MIME type values.
404
413
414
+
**Important:** This change affects not only direct usage of `express.static.mime` but also other Express methods that rely on MIME type detection, such as `res.sendFile()`. The following MIME types have changed from Express 4:
415
+
416
+
- JavaScript files (.js): now served as "text/javascript" instead of "application/javascript"
417
+
- JSON files (.json): now served as "application/json" instead of "text/json"
418
+
- CSS files (.css): now served as "text/css" instead of "text/plain"
419
+
- HTML files (.html): now served as "text/html; charset=utf-8" instead of just "text/html"
420
+
- XML files (.xml): now served as "application/xml" instead of "text/xml"
421
+
- Font files (.woff): now served as "font/woff" instead of "application/font-woff"
La funzione `res.sendfile()` è stata sostituita da una versione in cui ogni frase composta inizia con una lettera maiuscola che utilizza ad esempio `res.sendFile()` in Express 5.
327
327
328
+
**Note:** In Express 5, `res.sendFile()` uses the `mime-types` package for MIME type detection, which returns different Content-Type values than Express 4 for several common file types:
329
+
330
+
- JavaScript files (.js): now "text/javascript" instead of "application/javascript"
331
+
- JSON files (.json): now "application/json" instead of "text/json"
332
+
- CSS files (.css): now "text/css" instead of "text/plain"
333
+
- XML files (.xml): now "application/xml" instead of "text/xml"
334
+
- Font files (.woff): now "font/woff" instead of "application/font-woff"
335
+
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"
336
+
328
337
{% include admonitions/note.html content=codemod-deprecated-signatures %}
329
338
330
339
```js
@@ -348,6 +357,15 @@ The `router.param(fn)` signature was used for modifying the behavior of the `rou
348
357
In Express 5, `mime` is no longer an exported property of the `static` field.
349
358
Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work with MIME type values.
350
359
360
+
**Important:** This change affects not only direct usage of `express.static.mime` but also other Express methods that rely on MIME type detection, such as `res.sendFile()`. The following MIME types have changed from Express 4:
361
+
362
+
- JavaScript files (.js): now served as "text/javascript" instead of "application/javascript"
363
+
- JSON files (.json): now served as "application/json" instead of "text/json"
364
+
- CSS files (.css): now served as "text/css" instead of "text/plain"
365
+
- HTML files (.html): now served as "text/html; charset=utf-8" instead of just "text/html"
366
+
- XML files (.xml): now served as "application/xml" instead of "text/xml"
367
+
- Font files (.woff): now served as "font/woff" instead of "application/font-woff"
**Note:** In Express 5, `res.sendFile()` uses the `mime-types` package for MIME type detection, which returns different Content-Type values than Express 4 for several common file types:
329
+
330
+
- JavaScript files (.js): now "text/javascript" instead of "application/javascript"
331
+
- JSON files (.json): now "application/json" instead of "text/json"
332
+
- CSS files (.css): now "text/css" instead of "text/plain"
333
+
- XML files (.xml): now "application/xml" instead of "text/xml"
334
+
- Font files (.woff): now "font/woff" instead of "application/font-woff"
335
+
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"
336
+
328
337
{% include admonitions/note.html content=codemod-deprecated-signatures %}
329
338
330
339
```js
@@ -348,6 +357,15 @@ The `router.param(fn)` signature was used for modifying the behavior of the `rou
348
357
In Express 5, `mime` is no longer an exported property of the `static` field.
349
358
Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work with MIME type values.
350
359
360
+
**Important:** This change affects not only direct usage of `express.static.mime` but also other Express methods that rely on MIME type detection, such as `res.sendFile()`. The following MIME types have changed from Express 4:
361
+
362
+
- JavaScript files (.js): now served as "text/javascript" instead of "application/javascript"
363
+
- JSON files (.json): now served as "application/json" instead of "text/json"
364
+
- CSS files (.css): now served as "text/css" instead of "text/plain"
365
+
- HTML files (.html): now served as "text/html; charset=utf-8" instead of just "text/html"
366
+
- XML files (.xml): now served as "application/xml" instead of "text/xml"
367
+
- Font files (.woff): now served as "font/woff" instead of "application/font-woff"
Express 5에서 `res.sendfile()` 함수는 낙타 대문자(camel-cased) 버전인 `res.sendFile()`로 대체되었습니다.
327
327
328
+
**Note:** In Express 5, `res.sendFile()` uses the `mime-types` package for MIME type detection, which returns different Content-Type values than Express 4 for several common file types:
329
+
330
+
- JavaScript files (.js): now "text/javascript" instead of "application/javascript"
331
+
- JSON files (.json): now "application/json" instead of "text/json"
332
+
- CSS files (.css): now "text/css" instead of "text/plain"
333
+
- XML files (.xml): now "application/xml" instead of "text/xml"
334
+
- Font files (.woff): now "font/woff" instead of "application/font-woff"
335
+
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"
336
+
328
337
{% include admonitions/note.html content=codemod-deprecated-signatures %}
329
338
330
339
```js
@@ -348,6 +357,15 @@ The `router.param(fn)` signature was used for modifying the behavior of the `rou
348
357
In Express 5, `mime` is no longer an exported property of the `static` field.
349
358
Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work with MIME type values.
350
359
360
+
**Important:** This change affects not only direct usage of `express.static.mime` but also other Express methods that rely on MIME type detection, such as `res.sendFile()`. The following MIME types have changed from Express 4:
361
+
362
+
- JavaScript files (.js): now served as "text/javascript" instead of "application/javascript"
363
+
- JSON files (.json): now served as "application/json" instead of "text/json"
364
+
- CSS files (.css): now served as "text/css" instead of "text/plain"
365
+
- HTML files (.html): now served as "text/html; charset=utf-8" instead of just "text/html"
366
+
- XML files (.xml): now served as "application/xml" instead of "text/xml"
367
+
- Font files (.woff): now served as "font/woff" instead of "application/font-woff"
@@ -368,6 +368,15 @@ A função `res.sendfile()` foi substituída pela
368
368
versão em formato camel-case `res.sendFile()` no
369
369
Express 5.
370
370
371
+
**Note:** In Express 5, `res.sendFile()` uses the `mime-types` package for MIME type detection, which returns different Content-Type values than Express 4 for several common file types:
372
+
373
+
- JavaScript files (.js): now "text/javascript" instead of "application/javascript"
374
+
- JSON files (.json): now "application/json" instead of "text/json"
375
+
- CSS files (.css): now "text/css" instead of "text/plain"
376
+
- XML files (.xml): now "application/xml" instead of "text/xml"
377
+
- Font files (.woff): now "font/woff" instead of "application/font-woff"
378
+
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"
379
+
371
380
{% include admonitions/note.html content=codemod-deprecated-signatures %}
372
381
373
382
```js
@@ -392,6 +401,15 @@ foi descontinuada desde a v4.11.0, e o Express 5 não a suporta mais de nenhuma
392
401
In Express 5, `mime` is no longer an exported property of the `static` field.
393
402
Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work with MIME type values.
394
403
404
+
**Important:** This change affects not only direct usage of `express.static.mime` but also other Express methods that rely on MIME type detection, such as `res.sendFile()`. The following MIME types have changed from Express 4:
405
+
406
+
- JavaScript files (.js): now served as "text/javascript" instead of "application/javascript"
407
+
- JSON files (.json): now served as "application/json" instead of "text/json"
408
+
- CSS files (.css): now served as "text/css" instead of "text/plain"
409
+
- HTML files (.html): now served as "text/html; charset=utf-8" instead of just "text/html"
410
+
- XML files (.xml): now served as "application/xml" instead of "text/xml"
411
+
- Font files (.woff): now served as "font/woff" instead of "application/font-woff"
0 commit comments