Skip to content

A simple CDN made using Cloudflare Workers and Hono

License

Notifications You must be signed in to change notification settings

leambot/cdn-worker

 
 

Repository files navigation

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.

About

A simple CDN made using Cloudflare Workers and Hono

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%