Danny
Danny
CDCloudflare Developers
Created by Danny on 4/13/2023 in #r2
R2 <> NextJS
and is --local needed?
14 replies
CDCloudflare Developers
Created by Danny on 4/13/2023 in #r2
R2 <> NextJS
If i define my bindings in my wrangler.toml do I have to run the command with --r2=BUCKET ?
14 replies
CDCloudflare Developers
Created by Danny on 4/13/2023 in #r2
R2 <> NextJS
but then this code triggers, so the env avraible is there but the object is null
14 replies
CDCloudflare Developers
Created by Danny on 4/13/2023 in #r2
R2 <> NextJS
if (obj === null) {
return new Response('Not found', { status: 404 });
}
if (obj === null) {
return new Response('Not found', { status: 404 });
}
14 replies
CDCloudflare Developers
Created by Danny on 4/13/2023 in #r2
R2 <> NextJS
This seems to work when i run the wrangler on the production build
14 replies
CDCloudflare Developers
Created by Danny on 4/13/2023 in #r2
R2 <> NextJS
okay that's good to know. I've been trying const obj = await process.env.CRYPTO_NOTIFICATIONS.get('gainers.csv'); which works on my production branch and wasn't working locally, so I tried console logging the process.env.CRYPTO_NOTIFICATIONS
14 replies
CDCloudflare Developers
Created by Danny on 4/13/2023 in #r2
R2 <> NextJS
No the object appears as R2Bucket {}, in the command line. I can see some options, like objects: {} inside of it
14 replies