File tree 1 file changed +9
-9
lines changed
docs/content/1.docs/2.storage
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,21 @@ Returns [`BlobListResult`](#bloblistresult).
61
61
62
62
Returns a blob's data.
63
63
64
- ``` ts [server/api/files/[...pathname\\ ].get.ts]
64
+
65
+ :: code-group
66
+ ``` ts [server/routes/images/[...pathname\\ ].get.ts]
65
67
export default eventHandler (async (event ) => {
66
68
const { pathname } = getRouterParams (event )
67
69
68
70
return hubBlob ().serve (event , pathname )
69
71
})
70
72
```
73
+ ``` vue [pages/index.vue]
74
+ <template>
75
+ <img src="/images/my-image.jpg">
76
+ </template>
77
+ ```
78
+ ::
71
79
72
80
#### Params
73
81
@@ -84,14 +92,6 @@ export default eventHandler(async (event) => {
84
92
85
93
Returns the blob's raw data and sets ` Content-Type ` and ` Content-Length ` headers.
86
94
87
- :: callout { icon =" i-heroicons-information-circle " class =" prose-code:bg-gray-50 dark:prose-code:bg-gray-800 " }
88
- If you are fetching an image with a server route similar to the one above, you might simply want to use it this way:
89
- <br >
90
- ``` vue
91
- <img :src="`/api/blob/${file.pathname}`">
92
- ```
93
- ::
94
-
95
95
### ` head() `
96
96
97
97
Returns a blob's metadata.
You can’t perform that action at this time.
0 commit comments