Host Files [Deprecated]
Static Hosting is deprecated. Learn More.
Introduction
Atlas Hosting allows you to host, manage, and serve your application's static media and document files. You can use Hosting to store individual pieces of content or to upload and serve your entire client application.
To get started, enable hosting for your application then start uploading content.
Important
Static Hosting Requires a Paid-Tier Atlas Cluster
To enable static hosting, you must have a paid-tier (i.e. M2
or
higher) Atlas cluster linked to your app as a data source. For more
information on Atlas cluster tiers, see Create a Cluster.
Concepts
Static Content
A file is static if you can serve it directly to clients without requiring additional processing or logic to generate it. Static content includes document files, such as HTML, JavaScript, and CSS, as well as media files like images, audio, and videos.
Hosting Domain
App Services hosts your application's content behind a unique domain name. By default, App Services uses domains of the following form:
<Your App ID>.mongodbstitch.com
Note
You can configure App Services to host content at a custom domain name that you own in addition to the default hosting domain.
Resource Paths
A resource path is a string that uniquely identifies an uploaded file based on its position in the file tree. You can access a hosted file through a unique URL that consists of your application's hosting domain followed by the file's resource path.
For example, a PNG image of a company's logo hosted in a directory named
images
would have the resource path /images/logo.png
. You could
access this image at a URL similar to the following:
myapp-abcde.mongodbrealm.com/images/logo.png
Constraints
App Services enforces constraints on static hosting across several dimensions for each app. The following constraints apply to all static content hosted by App Services:
Dimension | Constraint |
---|---|
Maximum File Size | 25 megabytes |
Maximum Total Storage | 1 gigabyte |
Maximum Total Files | 20,000 files |
Maximum CDN Flushes | 25 flushes per hour |
Maximum Bandwidth | 100 gigabytes |