Navigation

Enable Hosting

On this page

Overview

You need to enable static hosting for your application before you can upload and access content. You can enable static hosting from the Stitch UI or by importing an application directory that enables hosting in its configuration file. Select the tab below that corresponds to the method you want to use.

Procedure

1
2

Enable Hosting

On the Hosting configuration page, click Enable Hosting. Stitch will begin provisioning hosting for your application.

Note

It may take a few minutes for Stitch to finish provisioning hosting for your application once you’ve enabled it.

You can begin to can upload content to Stitch immediately but you will need to wait for provisioning to complete before Stitch will serve your files.

1

Export Your Stitch Application

To enable static hosting for your Stitch application with stitch-cli you need to export an application directory.

You can export your application configuration from the Export tab of the Settings page in the Stitch UI, or by running the following command from an authenticated instance of stitch-cli:

stitch-cli export --app-id=<App ID>
2

Enable Hosting in the Application Configuration

In stitch.json, set the value of hosting.enabled to true then save the file.

"hosting": { "enabled": true }
3

Import the Updated Application Configuration

Once you have enabled hosting in stitch.json, you can import the directory into your application.

Navigate to the root of the application directory and run the following command:

stitch-cli import

Stitch will begin provisioning hosting for your application after you successfully import the application directory.

Note

It may take a few minutes for Stitch to finish provisioning hosting for your application. You must wait for provisioning to complete before you can upload content to Stitch.