mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 09:27:08 +00:00
r2-image-server
- An example server of R2.
- This server can store / load / delete images in R2.
Usage
Endpoints
- GET
/{key}
- Get an image object at the
key
and returns it.
- Get an image object at the
- POST
/{key}
- Create an image object at the
key
and uploads image. - Request body must be binary and request header must have
Content-Type
.
- Create an image object at the
- DELETE
/{key}
- Delete an image object at the
key
.
- Delete an image object at the
Development
- See the following documents for details on how to use R2.
Requirements
This project requires these tools to be installed globally.
- wrangler
- tinygo
Commands
make dev # run dev server
make build # build Go Wasm binary
make deploy # deploy worker