@remix-run/static-middleware 0.4.2 → 0.4.4
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 +8 -10
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
# static-middleware
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Serves static files from a directory with support for ETags, range requests, and conditional requests.
|
|
3
|
+
Static file serving middleware for Remix. Serves static files from a directory with support for ETags, range requests, and conditional requests.
|
|
6
4
|
|
|
7
5
|
## Features
|
|
8
6
|
|
|
9
|
-
- [ETag
|
|
10
|
-
- [Range
|
|
11
|
-
- [Conditional request
|
|
7
|
+
- [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) support (weak and strong)
|
|
8
|
+
- [Range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests) support (HTTP 206 Partial Content)
|
|
9
|
+
- [Conditional request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests) support (If-None-Match, If-Modified-Since)
|
|
12
10
|
- Path traversal protection
|
|
13
|
-
- Automatic
|
|
11
|
+
- Automatic fallback to next middleware/handler if file not found
|
|
14
12
|
|
|
15
13
|
## Installation
|
|
16
14
|
|
|
17
15
|
```sh
|
|
18
|
-
npm
|
|
16
|
+
npm i remix
|
|
19
17
|
```
|
|
20
18
|
|
|
21
19
|
## Usage
|
|
@@ -23,8 +21,8 @@ npm install @remix-run/static-middleware
|
|
|
23
21
|
Static middleware is useful for serving static files from a directory.
|
|
24
22
|
|
|
25
23
|
```ts
|
|
26
|
-
import { createRouter } from '
|
|
27
|
-
import { staticFiles } from '
|
|
24
|
+
import { createRouter } from 'remix/fetch-router'
|
|
25
|
+
import { staticFiles } from 'remix/static-middleware'
|
|
28
26
|
|
|
29
27
|
let router = createRouter({
|
|
30
28
|
middleware: [staticFiles('./public')],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remix-run/static-middleware",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Middleware for serving static files from the filesystem",
|
|
5
5
|
"author": "Michael Jackson <mjijackson@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^24.6.0",
|
|
30
30
|
"@typescript/native-preview": "7.0.0-dev.20251125.1",
|
|
31
|
-
"@remix-run/fetch-router": "0.
|
|
32
|
-
"@remix-run/form-data-middleware": "0.1.
|
|
33
|
-
"@remix-run/
|
|
34
|
-
"@remix-run/
|
|
35
|
-
"@remix-run/
|
|
31
|
+
"@remix-run/fetch-router": "0.17.0",
|
|
32
|
+
"@remix-run/form-data-middleware": "0.1.4",
|
|
33
|
+
"@remix-run/mime": "0.4.0",
|
|
34
|
+
"@remix-run/response": "0.3.2",
|
|
35
|
+
"@remix-run/method-override-middleware": "0.1.4"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@remix-run/fetch-router": "^0.
|
|
39
|
-
"@remix-run/fs": "^0.4.
|
|
38
|
+
"@remix-run/fetch-router": "^0.17.0",
|
|
39
|
+
"@remix-run/fs": "^0.4.2",
|
|
40
40
|
"@remix-run/html-template": "^0.3.0",
|
|
41
|
-
"@remix-run/mime": "^0.
|
|
42
|
-
"@remix-run/response": "^0.3.
|
|
41
|
+
"@remix-run/mime": "^0.4.0",
|
|
42
|
+
"@remix-run/response": "^0.3.2"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"fetch",
|