Deploying a Node.js App
Now that the app is done, let's deploy the app to TIBCO Cloud™ Integration.
Before pushing your app to TIBCO Cloud Integration, it's best practice that your app be tested in your development environment.
Packaging the App
To upload your app you will need a ZIP archive containing all the code you have, except for the node_modules folder. The Node.js modules required by your code will be installed by TIBCO Cloud Integration after your app is pushed, as long as they are defined in the package.json file.
You can simply zip the folder that contains the server.js file (hello_world_nodejs_app_1501395218703 in our case). If you are comfortable with PowerShell you can also execute this command from that folder:
Get-ChildItem . |where { $_.Name -notin "node_modules"}|Compress-Archive -DestinationPath ./app.zip -Force| Out-Null
The other file we need to upload is the manifest.json file. The ZIP archive doesn't include the manifest file.
Pushing an App With the TIBCO Cloud™ - Command Line Interface (CLI)
-
Log in with the CLI as shown in Logging In with the TIBCO Cloud™ - Command Line Interface.
For example:
tibcli login -
Move your app and the
manifest.jsonfile into an empty temporary directory, and then change to that directory. For example, given an appmyApp.zipand manifest in your home directory:mkdir tmp-app cd tmp-app cp ~/myApp.zip . cp ~/manifest.json . -
Push the app using the
tibcli app pushcommand. For example, given thattibcliis in the path, push the app in the current directory:
If the push is successful, an app named as thetibcli app pushnameproperty in themanifest.jsonfile will be created and started on TIBCO Cloud Integration.
Notes:
- If there is an existing app with an identical name as the app that you are trying to push to the cloud, the existing app will be overwritten with the newly pushed app. You will not see a warning about it.
- App archives cannot exceed 100 MB in total size.
You can also use all the tibcli command-line parameters to specify the app name, the desired instance count, and so on.
Pushing an App With the Web Interface
See Importing an App for additional details.
- Log in to TIBCO Cloud Integration.
- From the top navigation bar, click Apps.
- On the Apps page, click Create/Import.
- Select All app types and then select Import a Node.js app. An import app dialog displays.
-
Drag and drop the ZIP archive file and manifest file
manifest.jsonfiles onto this dialog. If you are using Chrome, you can drag a folder into this window. You can also click browse to upload and find the files on your system. - Click Import App. The import progress is shown as the app is being uploaded, built, and deployed. After this is complete, your app is not running and has zero instances. To start and scale your app, see Starting, Stopping, And Scaling Apps.