From 8a4821d60bf7694e55f8e1b8f1f9f793a4e33f26 Mon Sep 17 00:00:00 2001 From: syumai Date: Sun, 29 May 2022 22:06:06 +0900 Subject: [PATCH] update README --- examples/r2-image-server/README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/r2-image-server/README.md b/examples/r2-image-server/README.md index 8702731..54ddaad 100644 --- a/examples/r2-image-server/README.md +++ b/examples/r2-image-server/README.md @@ -1,14 +1,26 @@ # r2-image-server -* An example server which returns image from Cloudflare R2. -* This server is implemented in Go and compiled with tinygo. +* An example server of R2. +* 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 +* 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 This project requires these tools to be installed globally.