Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.21 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.21 KB

CDN Worker

A simple CDN made using Cloudflare Workers, Cloudflare R2, and Hono.

Deploy to Cloudflare Workers

Prerequisites

  • A Cloudflare account
  • R2 Plan (starts of free)
  • KV namespace

Installation

The easiest method is to click the Deploy with Workers button above and going through the installation steps provided by Cloudflare.

There will not be a manual installation guide as of now. However, one may be added in the future. I recommend looking at the Cloudflare documentation.

Example

ShareX file name: cdn.sxcu

{
  "Version": "14.0.1",
  "Name": "cdn",
  "DestinationType": "ImageUploader, TextUploader, FileUploader",
  "RequestMethod": "POST",
  "RequestURL": "https://your.domain/upload",
  "Headers": {
    "Access-Token": "Recommended to be 64+ characters"
  },
  "Body": "MultipartFormData",
  "FileFormName": "image",
  "URL": "{json:url}",
  "DeletionURL": "{json:url}",
  "ErrorMessage": "{json:error}"
}

As for the KV namespace, keys should be users' access tokens and some sort of user identification for the value. For example: the users name.