Developing with fresh data

A major advantage of developing outside the appdesigner is that it is possible to use data from the stage or production servers while developing. Inside of the dev server there is a proxy server that proxies several routes to a configured Appframe host.

Changing the server used is as simple as updating the proxy hostname in the appframe section of package.json:

{
  ...
  "appframe": {
    ...
    "proxy": {
      "hostname": "stage.obet.no"
    }
  }
}

The dev server needs to be restared after changing the hostname.

Updating Data Objects in Stage

Article data objects should be modified on dev.obet.no. When developing with data from the stage server, the data objects are not automatically updated when they are changed on the dev server, and it is rarely desirable to publish an update just to synchronize the data objects. Use the repo script from the app directory to copy data objects for the article from the dev server to the stage server:

pnpm copy-datasources

The copy-datasources script copies data objects to the server configured in the appframe.proxy settings, so it will update whichever host is specified—including production when the proxy points there.

After copying the data sources, regenerate the TypeScript types:

pnpm generate-types

After updating data sources you might get errors in the application, since updating the client data objects can't be done using hot reload. Combined with browser caching, this means you may need to do a hard refresh after changing data objects using Ctrl+Shirt+R

Last updated

Was this helpful?