Making script changes to your local app
The scripts and setupScripts folders contain all the scripts and other files required for a local project setup and the operations of the app. You can edit these scripts and test the results in a project setup via a browser pointing to a local host or via the VS code plugin setup, which is a manual process. For the local browser setup, these scripts are served from the locally run server but you need to expose them using a cloudflare tunnel with the following steps:
Pre-requisite: To install the tunnel client, run
brew install cloudflared.
- Open a terminal and run
cloudflared tunnel --url http://localhost:8086. Wait for it to print a URL with the following format and copy it:https://<random-words>.trycloudflare.com. - Go to
app/public/config.js. - For the
setupZipFileOriginproperty value, replacehttps://<domain>.trycloudflare.comwithhttps://<your-random-words>.trycloudflare.comso that the value readshttps://<your-random-words>.trycloudflare.com/reference/project_setup/setupScripts.zip. - For the
projectZipFileOriginproperty value, replacehttps://<domain>.trycloudflare.comwithhttps://<your-random-words>.trycloudflare.comso that the value readshttps://<your-random-words>.trycloudflare.com/reference/project_setup/data.zip. - To stage the scripts, run
npm run pushScripts. - To start the local server, run
npm run watch. - Open a browser in private browsing mode to
http://localhost:8086/reference,then log in and create a project.
Note: Changes you make to the scripts in your IDE and push in the above procedure are in effect when the resources are created. If you want to alter scripts that have already been created in the database under the project's namespace, you can update them via the REST API or the Console App.