svg-to-image-proxy
Web function to generate PNGs from SVGs. Based on convert-svg-to-png which uses headless Chromium.
The proxy accepts a request for e.g. https://raster.example.com/example.png
and translates it to a request for
https://other-server.example.com/example.svg
. If the path doesn't contain
.png
, it passes is unchanged, e.g. https://raster.example.com/example
to
https://other-server.example.com/example
.
The query string is also forwarded upstream. Cache headers are forwarded downstream.
The host comes from the BASE_URL
environment variable.
Designed for Shields though may be useful for other application as well.
Deployment
Runs on Zeit Now.
License
This project is licensed under the MIT license.