将文件上传到firebase托管

时间:2014-10-20 20:10:19

标签: firebase-hosting

我正在尝试在firebase托管上为我的用户个人资料存储图像。目前,文件托管在S3上,这很好,但我意识到Firebase附带了10gig的免费托管。我在尝试上传到我的网站时遇到了CORS错误。有人可以告诉我需要在我的firebase.json文件中设置哪些配置,以允许上传到特定目录。 myfirebase10.firebaseapp.com/img

"firebase": "myfirebase10",
"public": "app",
"ignore": [
"firebase.json",
".*",
"**/node_modules/**"
],
"headers": [ {
    "source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
    "headers" : [ {
        "key" : "Access-Control-Allow-Origin",
        "value" : "*"
    } ]
}, {
    "source" : "**/*.@(jpg|jpeg|gif|png)",
    "destination": "/img",
    "headers" : [ {
        "key" : "Access-Control-Allow-Origin",
        "value" : "*"
    } ]
}, {
    "source" : "404.html",
    "headers" : [ {
        "key" : "Cache-Control",
        "value" : "max-age=300"
    } ]
} ]
}

0 个答案:

没有答案