Deployment Guide
Deploy QQ Music API to Cloudflare Workers.
Prerequisites
- GitHub account
- Cloudflare account (free tier works)
- QQ Music credentials
Method 1: Cloudflare Dashboard
Step 1: Fork Repository
- Visit qq-music-api
- Click Fork button
- Wait for fork to complete
Step 2: Create D1 Database
- Login to Cloudflare Dashboard
- Go to D1 SQL Database
- Click Create database
- Name:
qq-music-api - Click Create
- Copy the Database ID
Step 3: Create Worker
- Go to Workers & Pages
- Click Create → Create Worker
- Name:
qq-music-api - Click Deploy
Step 4: Connect Git Repository
- Go to Worker → Settings → Build
- Click Connect Git repository
- Authorize GitHub access
- Select your forked repository
- Leave Build command empty
- Click Save and Deploy
Step 5: Bind D1 Database
- Go to Settings → Bindings
- Click D1 database bindings → Add
- Variable name:
DB - D1 database: Select
qq-music-api - Click Save
Step 6: Configure Credentials
- Go to Settings → Variables and Secrets
- Click Add
- Type: Secret
- Name:
INITIAL_CREDENTIAL - Value: Your credential JSON
- Click Save and Deploy
Step 7: Initialize Database
Visit https://your-domain/admin to initialize the database.
Method 2: Wrangler CLI
bash
# Install Wrangler
npm install -g wrangler
# Login
wrangler login
# Clone repo
git clone https://github.com/tooplick/qq-music-api
cd qq-music-api
# Create D1 database
wrangler d1 create qq-music-api
# Update wrangler.toml with database_id
# Set credential secret
wrangler secret put INITIAL_CREDENTIAL
# Deploy
wrangler deployVerify Deployment
bash
# Homepage
https://your-domain/
# Credential status
https://your-domain/api/credential
# Test search
https://your-domain/api/search?keyword=test