Pages

You cannot create new modifications or variations through FProxy. You can only download content for modifications that already exist in the Frosmo back end. If you want to develop a new modification, you must first create the modification and its variations through the Control Panel or the Graniitti API.

If you want to test the content in your browser during development, make sure the FProxy server is running before you proceed.

To develop modification content:

  1. Create the modification through the Frosmo Control Panel or the Graniitti API.
  2. Download the content from the Frosmo back end with FProxy.
  3. Edit and test the content.
  4. Upload the edited content back to the Frosmo back end with FProxy.

You can also use FProxy to automatically upload changed content.

Downloading modification content

Use the fproxy download command to download the content of a single modification or all modifications from a site. The content includes templates and template defaults, if defined.

To download modification content:

  1. In your terminal, go to the sites directory. For example, the following command opens the /dev/my_sites subdirectory in your home directory:

    cd ~/dev/my_sites
  2. Run the fproxy download command. For more information, see the command syntax and examples below.

If a modification includes image variations or a tracking-type comparison group, these are not downloaded, since they contain no code content.

For more information about the directories and files that FProxy creates, see Files, directories, and modification content.

Command syntax

fproxy download <site_directory> <modification_id|all> [--debug] [--force]

The modification ID (and thereby the modification) must already exist in the Frosmo back end. If it does not, the command fails with an error message about the ID not existing.

Command examples

Download the content of modification 33556 from the site shop_company_com:

fproxy download shop_company_com 33556

Download the content of all modifications from the site shop_company_com:

fproxy download shop_company_com all

Download the content of all modifications from the site shop_company_com with debugging information displayed:

fproxy download shop_company_com all --debug

Download the content of modification 33556 from the site shop_company_com and overwrite existing local content files without prompting:

fproxy download shop_company_com 33556 --force

Editing and testing modification content

After you've downloaded the modification content, you can edit and develop it normally in your preferred source code editor. When you're finished, upload the content back to the Frosmo back end.

If you're using Windows and want to edit the content in a Windows application, the content must be stored in your Windows storage directory for the WSL, not in the WSL itself. For more information, see Installing the Windows Subsystem for Linux.

You can test the content during development using the Frosmo Debugger, provided you have the FProxy server running. For more information about the Frosmo Debugger, see Frosmo Debugger.

Uploading modification content

Use the fproxy upload command to upload the content of a single modification from your local file system to the Frosmo back end. The content includes a template and template defaults, if defined.

To upload modification content:

  1. In your terminal, go to the sites directory. For example, the following command opens the /dev/my_sites subdirectory in your home directory:

    cd ~/dev/my_sites
  2. Run the fproxy upload command. For more information, see the command syntax and examples below.

If the modification is a cached modification or uses a template, the custom script for the site is automatically updated and deployed to the CDN, making the updated modification immediately available to visitors on the site. In all other cases, the modification content is retrieved from the Frosmo back end, so the custom script requires no update.

Command syntax

fproxy upload <site_directory> <modification_id> [--debug]

The modification ID (and thereby the modification) must already exist in the Frosmo back end. If it does not, the command fails with an error message about the ID not existing.

Command examples

Upload the content of modification 33556 for the site shop_company_com:

fproxy upload shop_company_com 33556

Upload the content of modification 33556 for the site shop_company_com with debugging information displayed:

fproxy upload shop_company_com 33556 --debug

Automatically uploading changed modification content

Use the fproxy watch command to monitor for changes in your downloaded modification content and to automatically upload changed files. The content includes templates and template defaults, if defined.

To monitor for and automatically upload changes in modification content:

  1. In your terminal, go to the sites directory. For example, the following command opens the /dev/my_sites directory in your home directory:

    cd ~/dev/my_sites
  2. Run the fproxy watch command. For more information, see the command syntax and examples below.

    The command runs as a foreground task, so the command blocks the terminal session and does not return you to the prompt. If you want to continue using the terminal, open a new terminal session.

You have started monitoring for changes in the modification content. If a monitored file changes, FProxy automatically uploads the changed content to the Frosmo back end.

To stop monitoring for changes, press Ctrl+C / Cmd+C in your terminal.

Command syntax

fproxy watch <site_directory> [--debug]

Command examples

Monitor for and upload changes in the modification content for the site shop_company_com:

fproxy watch shop_company_com

Monitor for and upload changes in the modification content for the site shop_company_com with debugging information displayed:

fproxy watch shop_company_com --debug
  • No labels