Skip to content

Instantly share code, notes, and snippets.

@nathanclevenger
Last active December 2, 2022 11:18
Show Gist options
  • Save nathanclevenger/126ed7b4a7bf258f6b48efa97067def8 to your computer and use it in GitHub Desktop.
Save nathanclevenger/126ed7b4a7bf258f6b48efa97067def8 to your computer and use it in GitHub Desktop.
CURL to JSON
import curlToHar from 'https://pkg.do/curl-to-har'
import { json } from 'https://pkg.do/itty-router-extras'
export default {
fetch: req => {
const { origin, pathname, search } new URL(req.url)
const curl = curlToHar(pathname + search)
return json({curl})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment