Enable Hosting¶
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¶
- Stitch UI
- Import/Export
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 upload content to Stitch immediately but you will need to wait for provisioning to complete before Stitch will serve your files.
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:
Enable Hosting in the Application Configuration¶
In stitch.json, set the value of
hosting.enabled
to true
then save the file.
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 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 once you’ve enabled it. You can upload content to Stitch immediately but you will need to wait for provisioning to complete before Stitch will serve your files.