cf worker that uses aws rekognition's DetectModerationLabels
to check the safety of an image
this also includes scuffed auth for /labels
endpoint, so you can't just use this worker without the secret key
CF don't charge for the compute time that's caused by waiting for the rekognition api to respond, also easier to deploy than on lambda imo
- install wrangler & authenticate with cloudflare if you haven't already
- define aws credentials
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
(set withwrangler secret put
) - generate a bearer token that's cryptographically generated and set it as
BEARER_TOKEN
(or just remove the code responsible if you don't want auth) - deploy to cloudflare
pnpm run deploy