https://github.com/ghostdevv/request-bin
Simple request bin built on Cloudflare Workers
https://github.com/ghostdevv/request-bin
Last synced: about 1 month ago
JSON representation
Simple request bin built on Cloudflare Workers
- Host: GitHub
- URL: https://github.com/ghostdevv/request-bin
- Owner: ghostdevv
- License: mit
- Created: 2024-04-01T05:23:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T17:02:56.000Z (about 1 year ago)
- Last Synced: 2025-05-21T04:09:21.903Z (10 months ago)
- Language: TypeScript
- Homepage: https://bin.willow.sh
- Size: 97.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Request Bin
A simple cloudflare worker based request bin. You can use my hosted version at https://bin.willow.sh/ or [self host](#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](https://pnpm.io/). Open it in your favourite editor and run `pnpm install`.
2. Create KV Namespace
We use [Cloudflare KV](https://developers.cloudflare.com/kv/) to store the request bin data, so we need to create your namespace. You can do that on the [Cloudflare Dashboard](https://dash.cloudflare.com/?to=/:account/workers/kv/namespaces). You can name it whatever you like here, I went with `request-bin-DATA`.

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

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.

3. 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!