@beignet/provider-storage-s3 0.0.25 → 0.0.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/CHANGELOG.md +8 -0
- package/README.md +22 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @beignet/provider-storage-s3
|
|
2
2
|
|
|
3
|
+
## 0.0.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f2461a9: Add lazy Next route server loaders and update generated route files and package docs to avoid booting providers during production build imports.
|
|
8
|
+
|
|
9
|
+
## 0.0.26
|
|
10
|
+
|
|
3
11
|
## 0.0.25
|
|
4
12
|
|
|
5
13
|
## 0.0.24
|
package/README.md
CHANGED
|
@@ -143,22 +143,29 @@ should upload directly to S3 or an S3-compatible service:
|
|
|
143
143
|
|
|
144
144
|
```typescript
|
|
145
145
|
import { createUploadRouter } from "@beignet/core/uploads";
|
|
146
|
+
import { createUploadRoute } from "@beignet/next";
|
|
146
147
|
import { createS3UploadSigner } from "@beignet/provider-storage-s3";
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
148
|
+
import { postUploads } from "@/features/posts/uploads";
|
|
149
|
+
import { getServer } from "@/server";
|
|
150
|
+
|
|
151
|
+
export const { POST } = createUploadRoute(async () => {
|
|
152
|
+
const server = await getServer();
|
|
153
|
+
|
|
154
|
+
return createUploadRouter({
|
|
155
|
+
uploads: postUploads,
|
|
156
|
+
ctx: () => server.createContextFromNext(),
|
|
157
|
+
storage: server.ports.storage,
|
|
158
|
+
signer: createS3UploadSigner({
|
|
159
|
+
bucket: "my-app-assets",
|
|
160
|
+
region: "auto",
|
|
161
|
+
endpoint: "https://<account-id>.r2.cloudflarestorage.com",
|
|
162
|
+
credentials: {
|
|
163
|
+
accessKeyId: process.env.R2_ACCESS_KEY_ID!,
|
|
164
|
+
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY!,
|
|
165
|
+
},
|
|
166
|
+
keyPrefix: "production",
|
|
167
|
+
}),
|
|
168
|
+
});
|
|
162
169
|
});
|
|
163
170
|
```
|
|
164
171
|
|