For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Create and deploying updated web resources to MobileFirst Server
To make modified web resources available to deployed client Cordova applications, you package and upload them as an archive (.zip file) to the MobileFirst Server.
We use either MobileFirst Platform CLI or MobileFirst Operations Console to perform procedures on the updated web resources package:
- We can use MobileFirst Platform CLI commands to generate and upload the archive.
- We can use the MobileFirst Operations Console only to upload an existing archive.
Parent topic: Update Cordova client apps directly
Create and deploying updated web resources to the default MobileFirst Server
Procedure
- From the command line, navigate to the root of the Cordova project.
- Run the command:
mfpdev app webupdateThe updated web resources are packaged to an archive and uploaded to the default MobileFirst Server that is running in the developer workstation. The packaged web resources are located in the <cordova-project-root-folder>/mobilefirst/ folder.
The archive in the mobilefirst folder contains important metadata. It embeds the version of the cordova-plugin-mfp plug-in. Before it serves that archive to a mobile client, the server compares the client version with the plug-in version. If both versions are close enough (meaning that the three most significant digits are identical), Direct Update occurs normally. Otherwise, MobileFirst Server silently skips the update.
Create and deploying updated web resources to a non-default MobileFirst Server
Procedure
- Build the archive.
- Run the command:
mfpdev app webupdate [server-name] [runtime-name]For example:
mfpdev app webupdate myQAServer MyBankApps
Uploading a previously generated archive
Procedure
Run the command:
mfpdev app webupdate [server-name] [runtime-name] --file [path-to-packaged-web-resources] For example:
mfpdev app webupdate myQAServer MyBankApps --file mobilefirst/ios/com.mfp.myBankApp-1.0.1.zip
Uploading packaged web resources with the MobileFirst Operations Console
Procedure
- Build the archive.
mfpdev app webupdate --build
- Display the MobileFirst Operations Console from the following URL:
http://localhost:9080/mfpconsole/
Figure 1. MobileFirst Operations Console for uploading an archive
- Click an application version in the navigation sidebar.
- Click Upload Web Resources Archive and in the file chooser that is displayed, choose the archive for upload.