added /api/musickit/ for musickit passthrough

This commit is contained in:
booploops 2022-04-18 16:47:57 -07:00
parent 5857b280d4
commit f23753d910
3 changed files with 115 additions and 43 deletions

26
src/ciderkit/public.js Normal file
View file

@ -0,0 +1,26 @@
const CiderKit = {
v1: {
musickit: {
async mkv3(route, body, options) {
let opts = {
method: 'POST',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},
redirect: 'follow',
referrerPolicy: 'no-referrer',
body: {}
}
opts.body = JSON.stringify({
route: route,
body: body,
options: options
})
let response = await fetch("http://localhost:9000/api/musickit/v3", opts);
return response.json()
}
}
}
}