Skip to content

Instantly share code, notes, and snippets.

@nathanclevenger
Last active October 1, 2022 15:05
Show Gist options
  • Save nathanclevenger/6879562075da644e51a09440f30970da to your computer and use it in GitHub Desktop.
Save nathanclevenger/6879562075da644e51a09440f30970da to your computer and use it in GitHub Desktop.
Itty Router Example
import { Router } from 'https://pkg.do/itty-router'
import { withParams, json } from 'https://pkg.do/itty-router-extras'
const router = Router()
router.get('/', ({url}) => json({ url, 'Deploy your Gist 🚀': 'https://gist.do/6879562075da644e51a09440f30970da' }))
export default {
fetch: router.handle
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment