node.js - 云存储连接域与API服务器

标签 node.js express google-app-engine google-cloud-platform google-cloud-storage

我有一个应用程序引擎 Nodejs API,它为 API 以及 Express 的静态文件提供服务,效果很好,但我想拆分 API 和客户端的部署。

我用我的域名创建了一个存储桶,指向 CNAME 记录,并修改了我的 API 服务器,使其不提供静态文件或 index.html。

我已将文件上传到存储桶。我收到错误:

AccessDeniedAccess denied.Anonymous caller does not have storage.objects.get access to www.onedeeds.com/index.html.

感谢任何帮助或指导。

最佳答案

如果您直接从 Google 云端存储提供静态 html,则需要确保将文件设置为可公开访问。请参阅documentation here了解详情。

关于node.js - 云存储连接域与API服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52358399/

相关文章:

python - NDB 按重复 StructuredProperty 的特定实例的属性排序

python - 属性错误: '<Class name>' object has no attribute 'request'

sql - NoSQL和SQL如何选择?

node.js - npm 错误代码 EACCES 243。是什么导致 npm 缓存中的某些目录在未设置执行标志的情况下创建?

jquery - 在 Node.js 中使用 ajax post 后,HTML 页面未呈现

javascript - Express js API 中的端点 URI

google-app-engine - 用户可以上传到谷歌云存储吗?

javascript - console.log(错误.消息); & console.log(err[0].message);

node.js - Node : Can't bind to IPv6 localAddress while using https.请求()

javascript - 在使用新数据的 jQuery POST 请求后重新呈现 EJS 模板