Static Hosting Configuration Files
On this page
Note
This page describes a legacy configuration file format. You should
only use this information if you're using the deprecated
realm-cli
.
Any configuration files you pull with App Services CLI or export from the UI use the latest configuration version. For detailed information on the current configuration file format, see App Configuration.
app/ └── hosting/ ├── config.json ├── metadata.json └── files/ └── <files to host>
Static Hosting is deprecated. Learn More.
Hosting Configuration
You can enable and configure static file hosting for your
application in hosting/config.json
.
{ "enabled": <Boolean>, "custom_domain": "<Custom Domain Name>", "app_default_domain": "<Default Domain Name>" }
Field Name | Description |
---|---|
enabled Boolean | If true , static hosting is enabled for your app. |
custom_domain String | The custom domain name for
your application's hosted files. |
app_default_domain String | The default domain for your application's hosted files. Atlas App Services
automatically sets this value and you cannot change it. |
File Metadata
You can define metadata for any hosted file by adding an entry to
hosting/metadata.json
.
[ { "path": "<File Resource Path>", "attrs": [ { "name": "<Attribute Type>", "value": "<Attribute Value>" }, ... ] }, ... ]
Field | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
path String | The resource path of the file. | ||||||||||
attrs Array<Document> | An array of documents where each document represents a single metadata attribute. Attribute documents have the following form: Metadata Attribute Document
|
Note
If you do not specify a Content-Type
metadata attribute for a hosted
file, Atlas App Services will attempt to automatically add a Content-Type
attribute to it based on the file extension.
For example, App Services would automatically add the attribute
Content-Type: application/html
to the file myPage.html
.