daringsoul
daringsoul
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
So here is what I did, connect to bucket, put the index.html there, redirect url to index.html If there is a better way, let me know, but this is probably the best what I can do...
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
@zegevlier let's forget for a second about this whirlpool... Domain can link to either Pages or bucket, but not both, if i link to Bucket, i must use full paths, if i enter domain url, i will have invalid page or 404? If i link domain to pages with bucket, i will not have direct access to bucket because workers do not have a direct link, rather they just prepare method to be called from UI, did i read this correctly...? EX: some-domain.example -> With R2, i must provide full path some-domain.example/path/to/file.extension and entering "some-domain.example" returns 404 because no interface for R2... -> with Pages only index.html works and workers are ready for backend functions... there is no direct path to bucket, i have to call worker function to access bucket
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
I'm so sorry but I'm a noob and new to this thing
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
export default {
async fetch(request: Request, env: any) {
// For example, the request URL my-worker.account.workers.dev/image.png
const url = new URL(request.url);
const key = url.pathname.slice(1);
// Retrieve the key "image.png"
const object = await env.MY_BUCKET.get(key);

if (object === null) {
return new Response('Object Not Found', { status: 404 });
}

const headers = new Headers();
object.writeHttpMetadata(headers);
headers.set('etag', object.httpEtag);

return new Response(object.body, {
headers,
});
},
};
export default {
async fetch(request: Request, env: any) {
// For example, the request URL my-worker.account.workers.dev/image.png
const url = new URL(request.url);
const key = url.pathname.slice(1);
// Retrieve the key "image.png"
const object = await env.MY_BUCKET.get(key);

if (object === null) {
return new Response('Object Not Found', { status: 404 });
}

const headers = new Headers();
object.writeHttpMetadata(headers);
headers.set('etag', object.httpEtag);

return new Response(object.body, {
headers,
});
},
};
if my domain is example.work so according to CloudFlare documentation about functions How do i get to: example.work/folderA/folderB/folderC/someFile
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
is there a video that shows from A to Z how to do a simple website host with R2 bucket link to download files or so? Also, if i create a function, will i be able to download a file using a URL path, not a button on page to download?
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
this is not a client side code?
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
I am looking at this: https://github.com/longern/FlareDrive Is this right?
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
how do i have R2 bucket and pages both on same url
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
or maybe a guide
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
Could you please tell me how? is there a video i can follow step by step
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
That's why I said I am lost and I have been deleting and uploading and creating everything over and over
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
This is already done, 400 MB of large files exceeding 25 MB are on R2, I'd like to somehow reach my R2 bucket without exposing it...
23 replies
CDCloudflare Developers
Created by daringsoul on 9/3/2023 in #pages-help
I have bought a domain on CloudFlare and created an R2 bucket, but I am lost in config...
If i set my pages to custom domain, linking DNS, the url works but I can't access R2 without exposing it (I am putting a budget to have everything from one place, without needing APIs and without needing to expose anything...)
23 replies