feat: support serverless deployment (Vercel / Cloudflare Pages)

- Replace bcrypt (native) with bcryptjs (pure JS) — no native build on serverless
- Storage abstraction (lib/storage.js): local uploads/ for traditional deploy, S3-compatible (R2/MinIO/S3 via aws4fetch) for serverless
- DB pool auto-adapts to serverless (single connection, rotation, timeouts)
- next.config.js: standalone output only when DOCKER=1 (serverless skips it)
- Docs: serverless deployment section in README, S3 env vars in .env.example
This commit is contained in:
lezi-fun committed 2026-08-10 09:55:18 +08:00
1 parent 83239d498e
commit ec50efea89
15 files changed
+163 -143

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
// POST /api/auth/register
import bcrypt from 'bcrypt';
import bcrypt from 'bcryptjs';
import pool from '@/lib/db';
export async function POST(req) {