Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gewoonjaap/svg-to-png-cf-worker
SVG to PNG as Cloudflare Worker
https://github.com/gewoonjaap/svg-to-png-cf-worker
cloudflare cloudflare-worker cloudflare-workers png rust svg svg-to-png worker
Last synced: 10 days ago
JSON representation
SVG to PNG as Cloudflare Worker
- Host: GitHub
- URL: https://github.com/gewoonjaap/svg-to-png-cf-worker
- Owner: GewoonJaap
- Created: 2022-12-15T08:45:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-14T19:01:22.000Z (23 days ago)
- Last Synced: 2024-10-15T05:43:48.788Z (22 days ago)
- Topics: cloudflare, cloudflare-worker, cloudflare-workers, png, rust, svg, svg-to-png, worker
- Language: Rust
- Homepage: https://svg-to-png.mrproper.dev/https://docs.tandoor.dev/logo_color.svg
- Size: 90.8 KB
- Stars: 26
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![afbeelding](https://user-images.githubusercontent.com/33700526/207815865-9b471652-5723-4d35-8847-dce0fb9701eb.png)
# SVG to PNG Cloudflare Worker
SVG to PNG converter in Cloudflare Workers
# Installation
## Windows Specific
- Install [Strawberry Perl](https://strawberryperl.com/)## All OS
- Install [Rust](https://www.rust-lang.org/tools/install)
- Install [Cloudflare Wrangler](https://developers.cloudflare.com/workers/cli-wrangler/install-update)
- `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`:
```sh
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.