Skip to content

GewoonJaap/svg-to-png-cf-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

afbeelding

SVG to PNG Cloudflare Worker

SVG to PNG converter in Cloudflare Workers

Installation

Windows Specific

All OS

  • Install Rust
  • Install Cloudflare Wrangler
  • wrangler login
  • Create a Cloudflare worker with name: svg-to-png;
  • wrangler dev to local test
  • wrangler publish to publish to Cloudflare

Usage

https://svg-to-png.mrproper.dev/{SVG URL}

Demo: https://svg-to-png.mrproper.dev/https://docs.tandoor.dev/logo_color.svg

POST Request

You can also make a POST request with the SVG URL in the body. The body should be a JSON object containing the URL.

Example using curl:

curl -X POST -H "Content-Type: application/json" -d '{"url": "https://docs.tandoor.dev/logo_color.svg"}' https://svg-to-png.mrproper.dev

This will convert the SVG at the specified URL to a PNG and return the PNG image.