Docs Menu
Docs Home
/ /
Atlas App Services
/ /

静的ホスティング構成ファイル

項目一覧

  • ホスティング構成
  • File Metadata
app/
└── hosting/
├── config.json
├── metadata.json
└── files/
└── <files to host>

hosting/config.jsonでアプリケーションの静的ファイルホスティングを有効にして構成できます。

config.json
{
"enabled": <Boolean>,
"custom_domain": "<Custom Domain Name>",
"app_default_domain": "<Default Domain Name>"
}
フィールド名
説明
enabled
boolean
trueの場合、アプリで静的ホスティングが有効になっています。
custom_domain
string
アプリケーションのホストされたファイルのカスタム ドメイン名
app_default_domain
string
アプリケーションのホストされたファイルのデフォルトのドメイン。 この値は Atlas App Services によって自動的に設定され、変更することはできません。

エントリをhosting/metadata.jsonに追加することで、ホストされたファイルのメタデータを定義できます。

metadata.json
[
{
"path": "<File Resource Path>",
"attrs": [
{
"name": "<Attribute Type>",
"value": "<Attribute Value>"
},
...
]
},
...
]
フィールド
説明
path
string
ファイルのリソース パス
attrs
object[]

各ドキュメントが 1 つのメタデータ属性を表すドキュメントの配列。 属性ドキュメントの形式は次のとおりです。

Metadata Attribute Document
{
"name": "<Attribute Type>",
"value": "<Attribute Value>"
}
フィールド
説明
name
string
メタデータ属性の名前。 これは、App Services がサポートするファイル メタデータ属性の 1 つです。
value
string
メタデータ属性の値。

注意

ホストされたファイルにContent-Typeメタデータ属性を指定しない場合、Atlas App Services はファイル拡張子に基づいてContent-Type属性を自動的に追加しようとします。

たとえば、Atlas App Services はファイルmyPage.htmlに属性Content-Type: application/htmlを自動的に追加します。

戻る

GraphQL