Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/content/blog/1.beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ Let’s explain what the module and the admin are responsible for.
**The NuxtHub module** allows you to access a SQL database, blob and KV storage (and more features) with zero configuration.

In development, it generates a `.data/hub/wrangler.toml` file and uses [Cloudflare Proxy](https://developers.cloudflare.com/workers/wrangler/api/#getplatformproxy) to connect to the desired bindings:
- [`hubDatabase()`](/docs/features/database) -> [Cloudflare D1](https://www.cloudflare.com/developer-platform/d1/)
- [`hubKV()`](/docs/features/kv) -> [Cloudflare KV](https://www.cloudflare.com/developer-platform/workers-kv/)
- [`hubBlob()`](/docs/features/blob) -> [Cloudflare R2](https://www.cloudflare.com/developer-platform/r2/)
- [Database](/docs/features/database) with [Drizzle ORM](https://orm.drizzle.team) → [Cloudflare D1](https://www.cloudflare.com/developer-platform/d1/)
- [`hubKV()`](/docs/features/kv) [Cloudflare KV](https://www.cloudflare.com/developer-platform/workers-kv/)
- [`hubBlob()`](/docs/features/blob) [Cloudflare R2](https://www.cloudflare.com/developer-platform/r2/)

In production, it reads from the bindings set in your Cloudflare dashboard following a specific naming convention: DB, BLOB, KV.

Note that `hubDatabase()`, `hubKV()` and `hubBlob()` server utils are a bit different than the binding itself to provide more features and a better developer experience when used in a Nuxt application.
Note that `hubKV()` and `hubBlob()` server utils are a bit different than the binding itself to provide more features and a better developer experience when used in a Nuxt application.

::callout{icon="i-lucide-rocket"}
By leveraging bindings, you never have to add secret keys or tokens to your Nuxt application in order to access the database, KV or blob. The underlying secret is never exposed to your Nuxt server’s code, and therefore can’t be accidentally leaked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ That's it! We have a minimal and fully functional drawing application.

You may have noticed that the last drawing is displayed last, this is because Cloudflare R2 is using alphabetical order to list the files and we use the timestamp (using `Date.now()`) as the file name. Also, R2 doesn't support listing files with a custom order.

Even though it's easy to add a Cloudflare D1 database with [`hubDatabase()`](/docs/storage/database), I wanted to keep this example as simple as possible.
Even though it's easy to add a Cloudflare D1 database with [NuxtHub Database](/docs/features/database), I wanted to keep this example as simple as possible.

Instead, I had the idea to use the timestamp in 2050 minus the timestamp of the drawing to get a descending order. It's not perfect but it works, until 2050, it's still a long time 😄.

Expand Down
Loading
Loading