Detailed Deployment Guide
Deploying One Balance to Cloudflare Worker involves the following key steps.
- environmental preparation
- Cloning Project Warehouse.
git clone https://github.com/glidea/one-balance.git
- Go to the project directory.
cd one-balance
- Use pnpm to install dependencies::
pnpm install
- Cloning Project Warehouse.
- Key Configuration
- Mac/Linux users.
AUTH_KEY=your-key pnpm run deploycf
- Windows users (PowerShell).
$env:AUTH_KEY = 'your-key'; pnpm run deploycf
- Mac/Linux users.
- login verification
- Ensure that you have installed and logged into Cloudflare's wrangler tool
- The deployment process automatically creates the D1 database
- Deployment Validation
- Generated Worker URL format.
https://one-balance-backend.<your-subdomain>.workers.dev
- Test API response using curl or browser
- Generated Worker URL format.
Note: Users in mainland China may need a VPN to access the Cloudflare service. If you encounter problems during deployment, check the terminal logs or GitHub Issues for help.
This answer comes from the articleOne Balance: a load balancing tool for intelligently managing AI API keys via Cloudflare AI GatewayThe