kwhitley / itty.dev

Documentation for itty ecosystem.
16 stars 13 forks source link

Missing AutoRouter Instantiation in Getting Started #23

Closed zayKenyon closed 5 months ago

zayKenyon commented 5 months ago

Getting Started -> Complete Example -> AutoRouter

import { AutoRouter } from 'itty-router'

+ const router = AutoRouter()

router
  .get('/hello/:name', ({ name }) => `Hello, ${name}!`)
  .get('/json', () => ({ foo: 'bar' }))
  .get('/throw', (a) => a.b.c) // safely throws

export default router
kwhitley commented 5 months ago

Dang dude, my bad! ❤️