跳转到主要内容
CuteJSON
↑↓ 导航 Enter 选择 Esc 关闭

Firebase 配置

中级 配置文件

Firebase Firestore 规则和带有缓存头的托管配置。 一个真实、可直接使用的示例,你可以复制、调整,或用来测试自己的代码。

{
  "firestore": {
    "rules": "rules_version = '2';\nservice cloud.firestore {\n  match /databases/{database}/documents {\n    match /users/{userId} {\n      allow read, write: if request.auth.uid == userId;\n    }\n  }\n}"
  },
  "hosting": {
    "public": "dist",
    "rewrites": [
      { "source": "/**", "destination": "/index.html" }
    ],
    "headers": [
      {
        "source": "/assets/**",
        "headers": [
          { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }
        ]
      }
    ]
  }
}
JSON 示例