update migration
This commit is contained in:
16
MIGRATION.md
16
MIGRATION.md
@@ -4,13 +4,29 @@ From `v1.x.x` to `v2.x.x`.
|
|||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
|
- [Preparation](#preparation)
|
||||||
|
- [Update](#update)
|
||||||
- [Import / Require](#import--require)
|
- [Import / Require](#import--require)
|
||||||
- [Routes](#routes)
|
- [Routes](#routes)
|
||||||
- [Fetch](#fetch--routerhandle)
|
- [Fetch](#fetch--routerhandle)
|
||||||
|
|
||||||
|
|
||||||
|
## Preparation
|
||||||
|
|
||||||
|
Follow Cloudflare's [Migration Guide](https://developers.cloudflare.com/workers/wrangler/migration/migrating-from-wrangler-1/) to update your protject to [wrangler2](https://github.com/cloudflare/wrangler2).
|
||||||
|
|
||||||
|
## Update
|
||||||
|
|
||||||
|
Update to the latest version verstion
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm i -D @tsndr/cloudflare-worker-router
|
||||||
|
```
|
||||||
|
|
||||||
## Import / Require
|
## Import / Require
|
||||||
|
|
||||||
|
Switch to ESModules.
|
||||||
|
|
||||||
### Before
|
### Before
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|||||||
Reference in New Issue
Block a user