update README

This commit is contained in:
syumai 2022-05-29 22:06:06 +09:00
parent 23bf82af32
commit 8a4821d60b

View File

@ -1,14 +1,26 @@
# r2-image-server # r2-image-server
* An example server which returns image from Cloudflare R2. * An example server of R2.
* This server is implemented in Go and compiled with tinygo. * This server can store / load / delete images in R2.
## Example ## Usage
* https://r2-image-server.syumai.workers.dev/syumai.png ### Endpoints
* **GET `/images/{key}`**
- Get an image object at the `key` and returns it.
* **PUT `/images/{key}`**
- Create an image object at the `key` and uploads image.
- Request body must be binary and request header must have `Content-Type`.
* **DELETE `/images/{key}`**
- Delete an image object at the `key`.
## Development ## Development
* See the following documents for details on how to use R2.
- https://developers.cloudflare.com/r2/runtime-apis
- https://pkg.go.dev/github.com/syumai/workers
### Requirements ### Requirements
This project requires these tools to be installed globally. This project requires these tools to be installed globally.