Disconnected mode support in the JSS React app

Current version: 19.x

The JSS disconnected mode enables the development of JSS apps using a local mock version of the Sitecore Headless Services - Layout Service and Dictionary Service.

When starting the JSS application for React in disconnected mode, the app runs a small Express application on a different port that hosts the mock services. The default port is 3042. The application proxies all requests to API paths to this mock service layer. You can inspect and customize this proxy for running the application in disconnected mode in the scripts/disconnected-mode-proxy.js file.

The application is built withcreate-react-app, which allows manual configuration of proxy behavior. Refer to the src/setupProxy.js file, where you can inspect different proxy configurations. When running the application in disconnected mode, the setup in this file enables the proxying of API requests to the mock server.

The mock services layer is powered by an automatically generated JSS manifest file. The file is generated from disconnected data definitions in the directories /data and /sitecore/definitions. This manifest regenerates automatically when you change the data. The application supports live reloading for such data changes.

Do you have some feedback for us?

If you have suggestions for improving this article,