3 Replies Latest reply on Jul 31, 2014 11:17 PM by aron.racho

    Where do you deploy your production addons?

    jesse.kinser

      I am new to Jive development using Node.js and I see that any addons that you create must be running and reachable via a specific address and port that you define in your jiveclientconfiguration.json file. I tried to deploy a tile addon to Azure websites hoping that would work but there is no way to define what port number Azure uses.

      Where do you deploy your production Jive addons at and how do you set your configuration file?

       

      I have created a stackoverflow question here as well: azure - Where do you deploy your jive addons in node.js? - Stack Overflow

        • Re: Where do you deploy your production addons?
          Robert Hanson

          For add-on where you want to deploy it into the cloud I would suggest reading this first.

           

          From Zero to Cloud Service in 20 minutes using the Jive SDK and Heroku

           

          Now, there are options depending on what features your add-on are using.  For example, a Jive App (aka OpenSocial gadget) with only client-side code really only needs an app.xml file to be hosted somewhere.  In this app.xml you can embed all of your HTML and JS content, and then host the app.xml in your own Jive instance (as a static file in a space) or just throw it up on any cloud service that let's you host files.  Then tweak the contents of extension.zip (the part that gets installed in Jive) and remove references to the registerURL and unregisterURL.  If there is no registration URL Jive will never need to post data to your service.  The only URL you will need to provide in the meta data is the URL to the app.xml, and maybe some external image files (all of which are static content that can be hosted anywhere on the web that allows static file hosting).

           

          So, it all depends on what you are doing.

           

          Another example are JiveAnywhere cartridges, which can be installed in the admin interface without having to be packaged as an add-on.

           

          Anyway, try Heroku first.  It's super easy to use and it's free if the demands of your app are small.

          • Re: Where do you deploy your production addons?
            aron.racho

            Hi there,

             

            You actually can have complete control over the startup parameters of your jive sdk service. See this app.js (instead of the usual one).

             

            See MY_ENV_PORT, MY_ENV_CLIENT_URL and other params that can be picked up from the environment.

             

            var express = require('express'),

                http = require('http'),

                jive = require('jive-sdk');

            var app = express();

             

            var failServer = function(reason) {

                console.log('FATAL -', reason );

                process.exit(-1);

            };

             

            var startServer = function () {

                if ( !jive.service.role || jive.service.role.isHttp() ) {

                    var server = http.createServer(app).listen( app.get('port') || process.env.MY_ENV_PORT, function () {

                        console.log("Express server listening on port " + server.address().port);

                    });

                }

            };

             

            jive.util.fsreadJson('jiveclientconfiguration.json').then( function(options) {

                options['port'] = process.env.MY_ENV_PORT || options['port'];

                options['clientUrl'] = process.env.MY_SREVICE_URL;

                options['databaseUrl'] = process.env.MY_ENV_DATABASE_URI || options['databaseUrl'];

                jive.service.init(app, options)

                    .then( function() { return jive.service.autowire() } )

                    .then( function() { return jive.service.start() } ).then( startServer, failServer );

            });

            Hope this helps too

            Aron