The experiences you create with developer edition of ArcGIS Experience Builder can be downloaded and hosted on a web server. Any experience that is using private content must be registered on ArcGIS Online or ArcGIS Enterprise. In order to provide the best user experience for your end-users, please see the system requirements prior to deploying your experience.
Download the experience
To download the experience, on the experience gallery home page click on the ellipsis (three dots)
and click Download
(make sure there is no error in your client terminal when the app includes custom widgets). A ZIP file is created and downloaded to your local drive. It is located in the download directory defined for your browser.
Deploy the experience
To deploy the experience on your web server, complete the following steps:
-
Unzip the downloaded experience and copy the folder to your web server.
-
If your app has private content, complete steps 3-6, otherwise your experience is deployed.
-
Add and register the app. See Create Client ID using ArcGIS Online or ArcGIS Enterprise for details.
-
Copy the
App
and open the appID config.json
file located in the root app folder (e.g. <.zip file root>\cdn\0\config.json). -
Create a
client
property under theId attributes
object. -
Paste the
App
in theID client
property in the app config.json file. Save the file.Id Use dark colors for code blocks Copy "attributes": { "portalUrl": "https://exb.maps.arcgis.com", "clientId": "EXBAPPsag0XSRtpj" },
The app is now available by browsing to your server/app name/index.html.
Automated deployments
To generate the app ZIP export automatically from a terminal without having the Experience Builder server running, use the zip
command. This is often used in DevOps workflows for automated deployments.
In the terminal, browse to the extracted root directory of your Experience Builder developer edition install (the directory that contains the “client” and “server” folders) and run the following command:
node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('0', 'app.zip', 'my_client_id');"
- Replace the ‘0’ with the ID of the app that you’d like to export.
- Replace the ‘app.zip’ with the name of the ZIP file you’d like it to generate.
- Replace the
my
with a valid_client _id App
from ArcGIS Online or ArcGIS Enterprise. See Create Client ID using ArcGIS Online or ArcGIS Enterprise for details. This third parameter is optional.ID - Ensure the
NODE
environmental variable is set to_ENV production
in order to create the production build that generates minified (smaller) files.
Starting at version 1.15, the zip
function supports an optional fourth parameter which is an object that can have properties of locales
or config
.
- The
locales
property can be used to specify the locales to export. If this is not set, all locales will be exported. - The
config
property can be used to modify theModifier config.json
file before exporting the app. It can be a function or an object.- If it is a function, it will be called with the
config
object and should return the modifiedconfig
object. - If it is an object, you can specify the update value like the below example.
- If it is a function, it will be called with the
{
configModifier: {
'attributes.portalUrl': 'new-portal-url'
}
}
There are more examples in the download-app.js
file.
Service worker cache
Experience Builder uses service workers to proactively control the caching of assets to improve the load times of your application. If a deployed application requires an update to its source code, config.json, or any other changes, you can do the update in the Developer edition, then re-download and deploy the app. However, if you need to do the update in the download package directly, you must complete the following steps to update the service worker cache.
- In your app directory, rename
cdn/0
tocdn/1
. - Modify any source code or changes you need to make in the app.
- Open
index.html
on your application's root folder.- Change
<base href="./cdn/0/"/
to> <base href="./cdn/1/"/
.> - Change the
build
toNumber = '0' build
.Number = '1'
- Change
To get better performance, here are some recommended settings for the cache header:
- Cache
index.html
for a very short period such as one minute or no cache. - Cache the
cdn
folder for a long period such as one year.