Skip to content

Commit

Permalink
rm logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jj committed Apr 24, 2022
1 parent 9b45a00 commit f6fbf41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
20 changes: 10 additions & 10 deletions examples/cf-workers/app/routes/api/image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ export const myResolver: Resolver = async (asset, url, options, basePath) => {
}
}

//const rewriteBlogody = (url: string) => {
// const parsed = new URL(url)
// if (parsed.host === 'assets.blogody.io' && parsed.pathname.startsWith('/image')) {
// parsed.host = SUPABASE_STORAGE_URL
// parsed.pathname = SUPABASE_STORAGE_PATH + parsed.pathname.substr(6)
// return parsed.toString()
// }
// return url
//}

const config = {
selfUrl: SELF_URL,
cache: new KVCache({ namespace: IMAGE_KV }),
Expand All @@ -36,3 +26,13 @@ const config = {
export const loader: LoaderFunction = ({ request }) => {
return imageLoader(config, request)
}

//const rewriteAssetUrl = (url: string) => {
// const parsed = new URL(url)
// if (parsed.host === 'assets.blogody.io' && parsed.pathname.startsWith('/image')) {
// parsed.host = SUPABASE_STORAGE_URL
// parsed.pathname = SUPABASE_STORAGE_PATH + parsed.pathname.substr(6)
// return parsed.toString()
// }
// return url
//}
3 changes: 0 additions & 3 deletions src/server/resolvers/cfResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const fitMap = {
}

export const cloudflareResolver: Resolver = async (_asset, url, { width, height, fit = ImageFit.CONTAIN, quality, position }) => {
console.log('cloudflareResolver0', url, width, height, fit, quality, position)
const imgRequest = new Request(url, {
headers: {
accept: 'image/*',
Expand All @@ -31,7 +30,6 @@ export const cloudflareResolver: Resolver = async (_asset, url, { width, height,
},
})

console.log('cloudflareResolver1', imageResponse.status, imageResponse.statusText)
if (imageResponse.status > 250) {
throw new RemixImageError('cloudflareResolver failed with status ' + imageResponse.status)
}
Expand All @@ -40,7 +38,6 @@ export const cloudflareResolver: Resolver = async (_asset, url, { width, height,

const buffer = new Uint8Array(arrBuff)
const contentType = imageResponse.headers.get('content-type')! as MimeType
console.log('cloudflareResolver2', contentType, buffer.byteLength)

return {
buffer,
Expand Down

0 comments on commit f6fbf41

Please sign in to comment.