Add cors headers. Updated fetch.

This commit is contained in:
Mike Cao 2020-07-18 03:33:33 -07:00
parent 70a239b0dc
commit 631d124a61
6 changed files with 39 additions and 3 deletions

View file

@ -14,7 +14,10 @@ const {
function post(url, params) {
return fetch(url, {
method: 'post',
mode: 'no-cors',
cache: 'no-cache',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(params),
}).then(res => res.json());
}