Docs Menu

Docs HomeAtlas App Services

Static Hosting Configuration Files

On this page

  • Hosting Configuration
  • File Metadata
app/
└── hosting/
├── config.json
├── metadata.json
└── files/
└── <files to host>

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.

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
{
"name": "<Attribute Type>",
"value": "<Attribute Value>"
}
Field
Description
name
string
The name of the metadata attribute. This should be one of the file metadata attributes that App Services supports.
value
string
The value of the metadata attribute.

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.

←  GraphQL Configuration FilesHTTPS Endpoint Configuration Files →