I tried to integrate the zero-tier in my web application. When ever i tried to call the API’s it gives a CORS error.
I’ve tried creating a new api token using it as header in the javascript file.
import React from 'react'
import axios from 'axios';
const ZerotierApi = () => {
const baseURL = "https://my.zerotier.com/api/v1/network";
const token = "p1zsXUqbQ8dD4YpH8VWb9ALl8RNUe0YB";
axios
.get(baseURL, {
headers: {
'Authorization': "bearer " + token
}
})
.then(function (response) {
console.log(response);
});
return (
<div>
</div>
)
}
export default ZerotierApi;