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)

  1. Log in with the CLI as shown in Logging In with the TIBCO Cloud™ - Command Line Interface. For example:
     tibcli login
    
  2. Move your app and the manifest.json file into an empty temporary directory, and then change to that directory. For example, given an app myApp.zip and manifest in your home directory:
     mkdir tmp-app
     cd tmp-app
     cp ~/myApp.zip .
     cp ~/manifest.json .
    
  3. Push the app using the tibcli app push command. For example, given that tibcli is in the path, push the app in the current directory:
     tibcli app push
    
    If the push is successful, an app named as the name property in the manifest.json file will be created and started on TIBCO Cloud Integration.

Notes:

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.

  1. Log in to TIBCO Cloud Integration.
  2. From the top navigation bar, click Apps.
  3. On the Apps page, click Create/Import.
  4. Select All app types and then select Import a Node.js app. An import app dialog displays.
  5. Drag and drop the ZIP archive file and manifest file manifest.json files 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.
  6. 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.
Note: Do not refresh your browser after clicking Import App until the push operation has completed. Refreshing the page will cancel the operation.

What to Do Next

Test Your Node.js App