Skip to content

Files

Latest commit

 

History

History

cloudflare

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Verifying API Keys using Cloudflare Workers

This is a minimal worker that verifies API keys using Cloudflare Workers

Install

pnpm install

Init

If you haven't already, initialize the worker.

pnpm wrangler init

Deploy

pnpm wrangler deploy

This will output the URL of the worker. Let's use it to send a request.

Test

Go to unkey.dev and create a new key. Then, send a request to the worker.

curl <URL_FROM_PREVIOUS_STEP> -H "Authorization: Bearer <KEY>"

It should return a 200 reponse with some data about the key.