Send sensor value to webpage using JS and REST API

I’m trying to retrieve the information of a sensor on a local webpage using the REST API. Using the same URL and authentication token, a CURL request works but a JS fetch() reports err 401 unauthorized.

The CURL being:

curl -X GET -H "Authorization: Bearer [authToken]"   http://[HOSTNAME]/api/states/[]

And the JS:

const url = "http://[HOSTNAME]/api/states/[]";
const options = {
  mode: 'no-cors',
  headers: {
    Authorization: "Bearer [authToken]"
fetch(url, options)
  .then( res => res.json() )
  .then( data => console.log(data) );

Does anyone know what I’m doing wrong? I don’t have a lot of experience with this.