Skip to content

Integrate Imagizer using a Cloudflare worker

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT
Notifications You must be signed in to change notification settings

Nventify/imagizer-cloudflare-worker

Repository files navigation

Imagizer Cloudflare Worker

Integrate Imagizer using a Cloudflare worker

Getting Started

demo

Install

This project requires NodeJS with the NPM package manager.

Clone this project

git clone git@github.com:Nventify/imagizer-cloudflare-worker.git
cd imagizer-cloudflare-worker

Install with NPM

# Install CloudFlare Wrangler
npm install @cloudflare/wrangler -g

# Install Project Dependencies
npm install

Setup

Login to your Cloudflare account and authorize this project.

wrangler login

Once authorized, update the wrangle.toml file with the following information.

  • The Cloudflare Zone ID, which can be found in the Cloudflare dashboard.
  • A route which matches your image locations. (ex: *example.com/product-images/*)
  • An Imagizer source domain. If you do not already have an Imagizer source domain, follow the steps in our docs here.

Publish

Publish the worker to your Cloudflare account.

wrangler publish

Congratulations! Your images will now be optimized through Imagizer.

Debug

Monitor the logs from the worker

wrangler tail --format pretty

Uninstall

You may remove the worker from the worker settings page on the Cloudflare Dashboard.


NOTE

You may need to review the Cloudflare Worker payment plans. Their free plan will cover up to 100,000 requests a day.

See our Cloudflare Integration docs for more information.

See Cloudflare's Wrangler docs for more information on the deployment process.


About

Integrate Imagizer using a Cloudflare worker

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Stars

Watchers

Forks

Packages

No packages published