This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A simple guide on how to use this Worker. | |
// To upload to the private bucket, you can send a POST request to the URL you want the file to end up at. | |
// For example: worker-url.com/images/user-1/subfolder/hi.png | |
// Once done, you can test your file by going to: | |
// worker-url.com/images/user-1/subfolder/h1.png | |
// Super simple API to use, much better than dealing with B2 directly, in my opinion. | |
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event)) |