โปรเจกต์ทดสอบ Supabase Edge Functions แบบครบวงจร พร้อม VS Code, GitHub, และ Vercel
- 🏠 Local Development - รันด้วย Deno
- ☁️ Supabase Edge Functions - Production deployment
- 🌐 Vercel Frontend - HTML interface สำหรับทดสอบ
- ⚙️ VS Code Integration - Tasks และ Extensions
- 🔧 TypeScript Support - Type safety
- 🌍 CORS Support - เรียกใช้จาก browser ได้
.
├── README.md
├── package.json
├── vercel.json # Vercel deployment config
├── test-function.html # HTML interface สำหรับทดสอบ
├── .vscode/
│ └── tasks.json # VS Code tasks
└── supabase/
├── config.toml
└── functions/
└── hello/
├── deno.json
└── index.ts # Main function
git clone https://github.com/YOUR_USERNAME/supabase-edge-functions-test.git
cd supabase-edge-functions-test
npm install
# วิธีที่ 1: ใช้ VS Code Task
# กด Ctrl+Shift+P → "Tasks: Run Task" → "Start Supabase Function (Deno)"
# วิธีที่ 2: รันด้วย command line
cd supabase/functions/hello
deno run --allow-net --allow-env index.ts
npx supabase login
npx supabase link --project-ref YOUR_PROJECT_REF
npx supabase functions deploy hello
- Push ไป GitHub
- Import repository ใน Vercel
- Deploy อัตโนมัติ
- Local Function:
http://localhost:8000
- Production Function:
https://YOUR_PROJECT.supabase.co/functions/v1/hello
- Test Interface:
https://YOUR_PROJECT.vercel.app
เปิด test-function.html
ใน browser หรือเข้า http://localhost:8000
- เข้า Vercel URL
- ใส่ Supabase Function URL
- ใส่ API Key (ถ้าจำเป็น)
- กดทดสอบ
{
"message": "Hello from Supabase Edge Functions! 🚀",
"timestamp": "2025-09-22T...",
"method": "GET",
"url": "...",
"userAgent": "...",
"status": "online",
"authStatus": "authenticated|anonymous",
"publicAccess": true,
"deployment": "production"
}
- Runtime: Deno
- Language: TypeScript
- Backend: Supabase Edge Functions
- Frontend: HTML/CSS/JavaScript
- Deployment: Vercel + Supabase
- Version Control: Git + GitHub
- IDE: VS Code
- Supabase Extension
- Deno Language Server
- Prettier Code Formatter
🚀 Start Local Function
- รัน function ใน localDeploy Supabase Function
- Deploy ไป productionTest Local Function
- ทดสอบด้วย curl
MIT License
- Fork the project
- Create feature branch
- Commit changes
- Push to branch
- Open Pull Request
Made with ❤️ using Supabase Edge Functions