Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 22, 2024
1 parent 727f80d commit cf4f84d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Cloudflare Bindings for Nitro and Nuxt Dev Server
# Cloudflare Bindings for Nitro and Nuxt

This is a proof of concept module to enable access to the Cloudflare runtime bindings in development server of [Nitro](https://nitro.unjs.io) and [Nuxt](https://nuxt.com) using new `getBindingsProxy` api exposed by wrangler.
This is a proof of concept module to enable access to the Cloudflare runtime bindings in the development server of [Nitro](https://nitro.unjs.io) and [Nuxt](https://nuxt.com) using the new `getBindingsProxy` API exposed by wrangler and [miniflare](https://miniflare.dev/)

> [!WARNING] > `getBindingsProxy` is not yet part of wrangler, we are just using the prerelease from: https://github.com/cloudflare/workers-sdk/pull/4523. The utility's API can still change
> [!WARNING]
> `getBindingsProxy` is not yet part of the wrangler, we are just using the prerelease from: https://github.com/cloudflare/workers-sdk/pull/4523. The utility's API can still change
> [!NOTE]
> Nitro project plans to introduce a new method to allow native dev presets, meaning you can natively run [miniflare](https://miniflare.dev/) as your development server without this module or a proxy in the future.
## Usage

1. Install `nitro-cloudflare-bindings` and `wrangler` packages as dev dependency
First, install `nitro-cloudflare-bindings` and `wrangler` packages as a dev dependency

```sh
npx nypm i -D wrangler nitro-cloudflare-bindings
```

(universal script uses [unjs/nypm](https://github.com/unjs/nypm) to automatically detect your package manager)

2. Add module
Then configure the module

**For [Nuxt](https://nuxt.com) projects:**

Expand All @@ -37,10 +38,14 @@ export default defineNitroConfig({
});
```

## Configuration and persistence

This module automatically finds the closest [`wrangler.toml`](https://developers.cloudflare.com/workers/wrangler/configuration/) file for configuration.

## Development

- Clone this repository
- Install latest LTS version of [Node.js](https://nodejs.org/en/)
- Install the latest LTS version of [Node.js](https://nodejs.org/en/)
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run Nitro playground using `pnpm dev:nitro` or Nuxt playground using `pnpm dev:nuxt`
Expand Down

0 comments on commit cf4f84d

Please sign in to comment.