Skip to content

experiment/front

 
 

Repository files navigation

front

Proxies and manipulates images, allowing user embedded content to be served from a single secure host at various sizes.

Deploy Circle CI


Usage

As proxy

Pass the remote image url to your front deployment as a url param. For example, to proxy an insecure gopher http://golang.org/doc/gopher/frontpage.png:

https://go-front.herokuapp.com/?url=http://golang.org/doc/gopher/frontpage.png

HTTPS Gopher

To resize images

Add width and height params to the standard proxy url. For example, for a smaller gopher:

https://go-front.herokuapp.com/?url=http://golang.org/doc/gopher/frontpage.png&width=125&height=175

Small Gopher


Deployment

The simplest method is to deploy on heroku:

Deploy

You'll probably want to add a CDN (e.g. CloudFront) to your front deployment for caching


Configuration

Config is via environment variables:

variable description optional
PORT The port to listen on no, though automatically set on heroku
ALLOWED_CONTENT_TYPE_REGEX Regex the upstream Content-Type must match in order to be proxied yes, defaults to ^image/

About

Front. Image proxy and manipulator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%