Static Hosting Configuration Files
On this page
Atlas Device Sync, Atlas Edge Server, Data API, and HTTPS Endpoints are deprecated. Refer to the deprecation page for details.
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
.
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
.
metadata.json
[ { "path": "<File Resource Path>", "attrs": [ { "name": "<Attribute Type>", "value": "<Attribute Value>" }, ... ] }, ... ]
Field | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
path string | The resource path of the file. | ||||||||||
attrs object[] | 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
.