Explanation:
- I have a Synology NAS that runs a lot of programs, Sonarr (automatic TV-show fetch) and SabNZB (downloader).
- I have EG running on my "TV-PC" that is always on 24/7.
- SabNzb have an API that allows me to take out different stuff, like history.
- I want to display say, 3 or 5 of my latest downloaded TV shows.
I have this code:
Code: Select all
<script src="https://npmcdn.com/axios/dist/axios.min.js"></script>Code: Select all
<script>
axios.get('http://11.0.0.30:8085/sabnzbd/api=myapikey?mode=history&start=START&limit=5').then(function(response) {
console.log(response.data) //Write it to the page here, however you want.
})
</script>When I press f12 in my browser I get this error: "No 'Access-Control-Allow-Origin' header is present on the requested resource"
and with a different code:
"No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'myip******' is therefore not allowed access. The response had HTTP status code 404. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled."
So, if I understand correctly, this is because the webpage (server) is on my home-computer and the sabnzb program is running on my NAS (With a different IP). Is that correct?
Does anyone know a way around this or could help me a bit? I'm really stuck.
Thanks in advance for any help!

