Closed Fiattarone closed 7 months ago
This would also allow using the module in a CloudFlare worker, which is also currently broken:
[wrangler:err] TypeError: adapter is not a function
at dispatchRequest (file:///Users/humphd/repos/chatcraft.org/node_modules/.pnpm/axios@0.17.1/node_modules/axios/lib/core/dispatchRequest.js:59:10)
[wrangler:inf] GET /api/proxy 500 Internal Server Error (85ms)
I'd love to see fetch()
be the default with fallback to axios()
only if necessary.
Thanks for this, works great in CloudFlare now!
Love how the npm demo of this worked with the timestamp, but unfortunately in my current project, I'm not able to use axios at all (browser extensions do not support axios). Figured I'd throw a PR your way to use the classic fetch if the program decides it's inside of a browser extension.
Overview of changes:
All ava tests passed before submitting this PR.
Let me know if there's any additional considerations I should be making before this can merge with master, happy to help!