xml is shown instead of site

隐身守侯 提交于 2021-01-01 05:07:02

问题


I am learning google cloud so I tried to deploy my react app there using storage service. For that i created a bucket called travelfrontend and uploaded the files and folders from build folder which is generated when using yarn build. I do not have any domain so i tried to access from https://storage.googleapis.com/travelfrontend but it shows me the following

I could not make it live. Did I miss anything to make it live?


回答1:


In order to serve the static content generated after running yarn build you need to set the MainPageSuffix property on your GCS bucket. This property will cause the file you specify (for example "index.html") to be served when accessing the root URL.

However, the bucket needs to be created and configured as stated in the following "Hosting a static website" docs. Note that you will have to point a custom domain to Cloud Storage by using a CNAME record.

After that, you will be able to set the MainPageSuffix as stated here

More info about CGS static website configuration can be found here

Hope this helps



来源:https://stackoverflow.com/questions/58947355/xml-is-shown-instead-of-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!