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>" }
フィールド名 | 説明 |
|---|---|
enabledboolean |
|
custom_domainstring | アプリケーションのホストされたファイルのカスタム ドメイン名。 |
app_default_domainstring | アプリケーションのホストされたファイルのデフォルトのドメイン。 この値は Atlas App Services によって自動的に設定され、変更することはできません。 |
File Metadata
エントリをhosting/metadata.jsonに追加することで、ホストされたファイルのメタデータを定義できます。
metadata.json
[ { "path": "<File Resource Path>", "attrs": [ { "name": "<Attribute Type>", "value": "<Attribute Value>" }, ... ] }, ... ]
フィールド | 説明 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
pathstring | ファイルのリソース パス。 | ||||||||||
attrsobject[] | 各ドキュメントが 1 つのメタデータ属性を表すドキュメントの配列。 属性ドキュメントの形式は次のとおりです。 Metadata Attribute Document
|
注意
ホストされたファイルにContent-Typeメタデータ属性を指定しない場合、Atlas App Services はファイル拡張子に基づいてContent-Type属性を自動的に追加しようとします。
たとえば、Atlas App Services はファイルmyPage.htmlに属性Content-Type: application/htmlを自動的に追加します。