1.3 KiB
1.3 KiB
Migration Guide
From v1.x.x to v2.x.x.
Contents
Preparation
Follow Cloudflare's Migration Guide to update your protject to wrangler2.
Update
Update to the latest version version of the router.
npm i -D @tsndr/cloudflare-worker-router
Import / Require
Switch from require() to import.
Before
const Router = require('@tsndr/cloudflare-worker-router')
After
import Router from '@tsndr/cloudflare-worker-router'
Routes
Just add curly braces {}.

