Last active
October 1, 2022 15:05
-
-
Save nathanclevenger/6879562075da644e51a09440f30970da to your computer and use it in GitHub Desktop.
Itty Router Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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