Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:24:16 +08:00
commit cfc6c441b5
22 changed files with 5629 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
{
"name": "my-worker-with-hyperdrive",
"main": "src/index.ts",
"compatibility_date": "2024-09-23",
"compatibility_flags": [
"nodejs_compat" // REQUIRED for database drivers (pg, postgres, mysql2)
],
"hyperdrive": [
{
// Binding name - access as env.HYPERDRIVE in your Worker
"binding": "HYPERDRIVE",
// Hyperdrive configuration ID from: wrangler hyperdrive create
"id": "<your-hyperdrive-id-here>",
// (Optional) Local development connection string
// Alternative: Use CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE env var
"localConnectionString": "postgres://user:password@localhost:5432/local_db"
}
],
// Example: Multiple Hyperdrive configurations
// "hyperdrive": [
// {
// "binding": "POSTGRES_DB",
// "id": "postgres-hyperdrive-id"
// },
// {
// "binding": "MYSQL_DB",
// "id": "mysql-hyperdrive-id"
// }
// ],
// Optional: Enable observability
"observability": {
"enabled": true
}
}