Skip to content

Commit 4b0d834

Browse files
committed
Change to Node.js Runtime
1 parent 8f1ac00 commit 4b0d834

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ Pick the hosting and storage option that best fits your needs:
2222
| Cloudflare Workers | R2 (Object Storage) | [![Deploy](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/Kodular/TinyWebDB-OneClick/tree/main/packages/cloudflare-r2) |
2323
| Vercel Edge Functions | KV (Redis) | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FKodular%2FTinyWebDB-OneClick%2Ftree%2Fmain%2Fpackages%2Fvercel-kv&project-name=tinywebdb-vercel-kv&repository-name=tinywebdb-vercel-kv&stores=%5B%7B%22type%22%3A%22kv%22%7D%5D) |
2424
| Vercel Edge Functions | Postgres | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FKodular%2FTinyWebDB-OneClick%2Ftree%2Fmain%2Fpackages%2Fvercel-postgres&project-name=tinywebdb-vercel-postgres&repository-name=tinywebdb-vercel-postgres&stores=%5B%7B%22type%22%3A%22postgres%22%7D%5D) |
25-
| Vercel Edge Functions | Blob Storage | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FKodular%2FTinyWebDB-OneClick%2Ftree%2Fmain%2Fpackages%2Fvercel-blob&project-name=tinywebdb-vercel-blob&repository-name=tinywebdb-vercel-blob&stores=%5B%7B%22type%22%3A%22blob%22%7D%5D) |
25+
| Vercel Functions | Blob Storage | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FKodular%2FTinyWebDB-OneClick%2Ftree%2Fmain%2Fpackages%2Fvercel-blob&project-name=tinywebdb-vercel-blob&repository-name=tinywebdb-vercel-blob&stores=%5B%7B%22type%22%3A%22blob%22%7D%5D) |
2626

2727
### Database Comparison
2828

29-
Note that Vercel does not "natively" offer a database option. Instead, different providers are offered in a marketplace.
30-
Still, 1-click deployment, but specific limits may vary from one option within the same "database type" to another.
29+
Note that Vercel does not "natively" offer a database option (except for the Blob storage). Instead, different
30+
providers are offered in a marketplace.
31+
Still, 1-click deployments, but specific limits may vary from one option within the same "database type" to another
32+
depending on the provider.
3133

3234
| Database | Type | Read Latency | Consistency | Max Value Size | Free Tier |
3335
|---------------------|----------------|--------------|-------------|----------------|----------------|

packages/vercel-blob/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# @tinywebdb/vercel-blob
22

3-
TinyWebDB deployment for Vercel Edge Functions with Blob storage.
3+
TinyWebDB deployment for Vercel Functions (Node.js Runtime) with Blob storage.
44

55
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FKodular%2FTinyWebDB-OneClick%2Ftree%2Fmain%2Fpackages%2Fvercel-blob&project-name=tinywebdb-vercel-blob&repository-name=tinywebdb-vercel-blob&stores=%5B%7B%22type%22%3A%22blob%22%7D%5D)
66

77
## Features
88

9-
- **Global edge deployment**: Runs on Vercel's Edge Network
10-
- **Unlimited storage**: No size limits for individual values
9+
- **Node.js Runtime**: Uses Vercel's Node.js runtime (required for @vercel/blob)
10+
- **Unlimited storage**: No size limits for individual values (up to 500 MB per blob)
1111
- **CDN distribution**: Automatic global content delivery
1212
- **Cost-effective**: Pay only for what you use
1313

packages/vercel-blob/api/index.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
2-
* Vercel Edge Function entry point for TinyWebDB with Blob storage
2+
* Vercel Function entry point for TinyWebDB with Blob storage
3+
* Uses Node.js Runtime (required for @vercel/blob compatibility)
34
*/
45

56
import { Application, HttpRequest } from '@kodular/tinywebdb-core';
@@ -52,7 +53,11 @@ function toVercelResponse(
5253
}
5354

5455
/**
55-
* Vercel Edge Function handler
56+
* Vercel Function handler (Node.js Runtime)
57+
*
58+
* Note: @vercel/blob requires Node.js runtime and is not compatible with Edge runtime.
59+
* The Edge runtime doesn't support the Node.js built-in modules (stream, net, http, etc.)
60+
* that @vercel/blob depends on.
5661
*/
5762
export default async function handler(request: Request): Promise<Response> {
5863
try {
@@ -69,7 +74,7 @@ export default async function handler(request: Request): Promise<Response> {
6974
// Convert response format
7075
return toVercelResponse(httpResponse);
7176
} catch (error) {
72-
console.error('Edge function error:', error);
77+
console.error('Function error:', error);
7378
return new Response(
7479
JSON.stringify({
7580
error: 'Internal Server Error',
@@ -82,10 +87,3 @@ export default async function handler(request: Request): Promise<Response> {
8287
);
8388
}
8489
}
85-
86-
/**
87-
* Configure this function to run on the Edge runtime
88-
*/
89-
export const config = {
90-
runtime: 'edge',
91-
};

0 commit comments

Comments
 (0)