ianh
ianh
Explore posts from servers
CDCloudflare Developers
Created by ianh on 5/27/2024 in #workers-help
Can't get CF transform via workers to do anything
Following this guide: https://developers.cloudflare.com/images/transform-images/transform-via-workers/#an-example-worker Using an unbelievably basic worker:
addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
const url = new URL(request.url);
const { pathname } = url;
const imageURL = 'https://pub-d6b4cd812c4c423984abcb97395046d5.r2.dev' + pathname;

const options = {
cf: {
image: {
width: '100',
height: '100',
fit: 'cover',
},
},
};

const imageRequest = new Request(imageURL, { headers: request.headers });
return fetch(imageRequest, options);
}
addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
const url = new URL(request.url);
const { pathname } = url;
const imageURL = 'https://pub-d6b4cd812c4c423984abcb97395046d5.r2.dev' + pathname;

const options = {
cf: {
image: {
width: '100',
height: '100',
fit: 'cover',
},
},
};

const imageRequest = new Request(imageURL, { headers: request.headers });
return fetch(imageRequest, options);
}
This doesn't seem to do anything, it just sends the full size image through. What am I doing wrong?
23 replies
CDCloudflare Developers
Created by ianh on 1/8/2024 in #general-help
Is POP/IMAP on the roadmap, or SMTP?
Been really enjoying the Email routing but it's only 1/2 the solution, would very much love to be able to at least do SMTP, or better yet, provide IMAP/POP accounts. Improvmx does this but I'd much rather have all services in the same location. Is this on the roadmap at all?
2 replies
CDCloudflare Developers
Created by ianh on 11/3/2023 in #general-help
Any update on this outage? It's > 24 hours now.
I'm a bit amazed at the size of this outage. Any updates? Much of our product has been down and we have lots of customer support inquiries asking about when this will be up. Nothing on twitter about the outage.
28 replies
CDCloudflare Developers
Created by ianh on 9/25/2023 in #pages-help
Custom domains always errors with Inactive (Error)
No description
66 replies
CDCloudflare Developers
Created by ianh on 8/13/2023 in #pages-help
Why do pages main branch use yarn 1 but preview branches use yarn 3?
Trying to get our preview branches working and its not honoring the packageManager field for yarn@1, its forcing yarn@3. Why? Our main branch uses yarn@1 no problems
5 replies
CDCloudflare Developers
Created by ianh on 7/25/2023 in #pages-help
Is there an example next.js on pages example repository?
Are there any example repositories which incorporate some sort of api/backend/fetch example? I've been unable to get any of the following working on nextjs/pages: - app directory with fetch - pages directory getServerSideProps - pages/api with edge untime Example which does something more than static text would be helpful, does anything like this exist?
8 replies
CDCloudflare Developers
Created by ianh on 3/19/2023 in #pages-help
Does Pages Build include user-specified ENV vars? They are not showing up
The docs say that builds include env vars: https://developers.cloudflare.com/pages/platform/build-configuration#environment-variables But when I console.log(process.env) the env vars are not there. Can someone from CF confirm that these vars are included during the build step?
13 replies