Open Larusyang opened 3 months ago
I use app router,but it seems the document doesn't provide details about how to use app router with cloudflare.
Hi, I am using it with cloudflare and pages but cloudflare require to run it on the EDGE. I don't know how to make it work that. Here is my config that works when the EDGE is not set
import { APIRoute } from 'next-s3-upload'
export default APIRoute.configure({
key(req) {
const cid = req.body.cid as string
return cid
},
accessKeyId: process.env.R2_ACESSS_ID,
secretAccessKey: process.env.R2_SECRET_ID,
bucket: process.env.BUCKET,
region: 'us-east-1',
endpoint: https://${process.env.R2_ACCOUNT_ID}.r2.cloudflarestorage.com
,
})
export const runtime = 'edge'
Since it use the same repo