@porulle/adapter-local-storage 0.6.0 → 0.7.0
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 +13 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,7 +17,19 @@ export default defineConfig({
|
|
|
17
17
|
});
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Then serve the `basePath` directory at `baseUrl
|
|
20
|
+
Then serve the `basePath` directory at `baseUrl`. The adapter generates URLs as `${baseUrl}/${key}`, so a mount for `/assets/*` must strip the `/assets` prefix before resolving against `basePath` — otherwise Hono looks the file up at `basePath/assets/<key>` and every asset 404s:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { serveStatic } from "@hono/node-server/serve-static";
|
|
24
|
+
|
|
25
|
+
app.use(
|
|
26
|
+
"/assets/*",
|
|
27
|
+
serveStatic({
|
|
28
|
+
root: "./.data/media",
|
|
29
|
+
rewriteRequestPath: (path) => path.replace(/^\/assets/, ""),
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
```
|
|
21
33
|
|
|
22
34
|
## Path-traversal protection
|
|
23
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porulle/adapter-local-storage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@porulle/core": "0.
|
|
14
|
+
"@porulle/core": "0.7.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/node": "^24.5.2",
|