Skip to content

itty-router

VersionBundle SizeCoverage StatusNPM Weekly DownloadsDiscord

An ultra-tiny API microrouter, for use when size matters (e.g. Cloudflare Workers).


Features

Example

js
import { AutoRouter } from 'itty-router' // ~1kB

const router = AutoRouter()

router
  .get('/hello/:name', ({ name }) => `Hello, ${name}!`)
  .get('/json', () => [1,2,3])
  .get('/promises', () => Promise.resolve('foo'))

export default router

// that's it ^-^

Released under the MIT License.