Written by
Aaron Bell
on
on
I used the JS Fetch API with audio data using Clojure(Script)
I learned to use the JS Fetch API with audio data using ClojureScript. To send an audio file to the client, I learned the JS Fetch and FormData API (I’m unsure how else to send the audio data). The creators made Fetch promise-based, so this means understanding JS promises and the ClojureScript interop for it. I also learned about http headers. The fetch failed until I made the server (not the client) send an “Access-Control-Allow-Origin” header set to “localhost:3450” or “*”. Fetch failed with other values like “no-cors” and “null”.