Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 755 Bytes

README.md

File metadata and controls

29 lines (24 loc) · 755 Bytes

image-proxy

image proxy utilities for client apps

Strategies

  1. proxy - route http photo through our https proxy
  2. swap - swap protocols from http to https
  3. null/nil/undefined - no strategy, return original

Installation

yarn add @wrstudios/image-proxy

Publishing a new version

  1. Make changes on branch
  2. Commit changes
  3. Merge changes into master
  4. yarn bump: [patch|minor|major]
  5. Update package dependency to new version in consuming apps.

Quick Start

import { getProxiedImageUrl } from "@wrstudios/image-proxy";

const strategy = "swap"
const url = "http://something.com/image"
const finalImageUrl = getProxiedImageUrl({ url, strategy })
console.log(finalImageUrl) //=> https://something.com/image