@wooksjs/http-static 0.4.24 → 0.4.27
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 +6 -6
- package/dist/index.cjs +1193 -1208
- package/dist/index.mjs +1193 -1208
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,10 +13,10 @@ Wooks Serve File is composable static file server for [@wooksjs/event-http](http
|
|
|
13
13
|
|
|
14
14
|
`serveFile` returns a readable stream and prepares all the neccessary response headers (like content-length, content-type etc).
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
16
|
+
- ✅ returns a readable stream
|
|
17
|
+
- ✅ prepares all the neccessary response headers (like content-length, content-type etc)
|
|
18
|
+
- ✅ can handle etag
|
|
19
|
+
- ✅ can handle ranges
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
@@ -67,8 +67,8 @@ serveFile(filePath, options)
|
|
|
67
67
|
import { useRouteParams } from 'wooks'
|
|
68
68
|
import { serveFile } from '@wooksjs/http-static'
|
|
69
69
|
app.get('static/*', () => {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const { get } = useRouteParams()
|
|
71
|
+
return serveFile(get('*'), { cacheControl: { maxAge: '10m' } })
|
|
72
72
|
})
|
|
73
73
|
```
|
|
74
74
|
|