共用方式為


CorsOptions interface

定義選項,以控制索引的跨原始來源資源分享 (CORS) 。

屬性

allowedOrigins

JavaScript 程式碼將授與索引存取權的來源清單。 可以包含 {protocol}://{完整-domain-name}[:{port#}] 格式的主機清單,或單 * 一允許所有來源 (不建議) 。

maxAgeInSeconds

瀏覽器應該快取 CORS 預檢回應的持續時間。 預設為 5 分鐘。

屬性詳細資料

allowedOrigins

JavaScript 程式碼將授與索引存取權的來源清單。 可以包含 {protocol}://{完整-domain-name}[:{port#}] 格式的主機清單,或單 * 一允許所有來源 (不建議) 。

allowedOrigins: string[]

屬性值

string[]

maxAgeInSeconds

瀏覽器應該快取 CORS 預檢回應的持續時間。 預設為 5 分鐘。

maxAgeInSeconds?: number

屬性值

number