Skip to content

ghostdevv/request-bin

Repository files navigation

Request Bin

A simple cloudflare worker based request bin. You can use my hosted version at https://bin.willow.sh/ or self host!

Endpoints

ANY /:id

You can send any non-GET request to this endpoint and it'll be saved for you. E.g. a webhook via a POST request.

If you send a GET request it'll return all the saved requests. The data includes the JSON body, headers, and a timestamp.

GET /new

This endpoint will create a new id and redirect you to it. It's not required as all uuids (v4) are automatically valid request bins.

Self Host

  1. Setup this repository locally

We'll need to get the request bin running locally, which requires NodeJS 18+ and pnpm. Open it in your favourite editor and run pnpm install.

  1. Create KV Namespace

We use Cloudflare KV to store the request bin data, so we need to create your namespace. You can do that on the Cloudflare Dashboard. You can name it whatever you like here, I went with request-bin-DATA.

kv namespace screenshot

Find the wrangler.toml file in the repo and replace the current namespace id with your new one.

wrangler toml edit screenshot

You'll also need to edit the account_id field in the same wrangler.toml, if you don't know this it'll be in the URL on the Cloudflare dashboard.

screenshot of cloudflare url with account id highlighted

  1. Deploy

Running pnpm run deploy will build and deploy the worker to Cloudflare. Once it's published you can visit the generated URL and you have your very own request bin!

About

Simple request bin built on Cloudflare Workers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors