Last active
December 2, 2022 11:18
-
-
Save nathanclevenger/126ed7b4a7bf258f6b48efa97067def8 to your computer and use it in GitHub Desktop.
CURL to JSON
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 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