seguler / static-website-blob-browser

Static Website - File Browser App for Blob Storage
26 stars 18 forks source link

Loading #2

Open elproducto opened 5 years ago

elproducto commented 5 years ago

I followed the direction to setup the React App, but for some reason my instance is stuck on the "Loading...", page never actually loads. Not sure what else I would need to tweak to ensure the page loads properly.

seguler commented 5 years ago

It must be an issue with the CORS config. Have you configured the CORS settings ?

elproducto commented 5 years ago

I have configured the CORS setting per instruction provided. Allowed Origin was copied and pasted from Statis website menu. I then selected Delete, Get, Put, Head, and Options, and put * in Allowed headers, and Exposed Headers. Is there any other setting I am missing? I also Public Access for container was selected in Access Policy.

jeffjkwok commented 5 years ago

I also have the same issue. I have set the CORS in the portal according to the instructions that were provided but I am still getting a '403 (CORS not enabled or no matching rule found for this request)'

EDIT: Found that when setting the endpoints in CORS in the portal the url SHOULD NOT have a forward slash at the end of the url

darreloneil commented 5 years ago

I was just experiencing the very same issue. A forward slash at the end of the CORS endpoint was causing this error.

elproducto commented 5 years ago

My issue remains. I am not getting an error message, rather the React App is stuck on loading(Pictured Below). My CORS endpoint setting does not have a trailing forward slash. I will attempt to upload the project again to see if it load, my issue does not seem like it is related to Azure setting, it seem more like an issue with the React App.

image

darreloneil commented 5 years ago

Make sure you change the account name in index.js to your own azure storage account. This was the only other change I needed to make. Hope this helps.

// Account name, and the container to list from
const account = 'staticwebsitedemo'
const container = '$web'
david-pham-us commented 3 years ago

The prompt "Loading..." means for some reasons the Blob API could not enumerate the blobs in the container.... And one of the reason is the API does not have permission to read the container. By default, when the $web container is created, it Public Access Level is set to "Private" which causes this error. Just changing the access level to "container = Allow anonymous read access for blobs and containers" will fix it.

FYI: The best is to create a new container and point to it (i.e. const container = 'Images'). This way, users will not see the React App source code.

image