Giter Club home page Giter Club logo

Comments (4)

ryanrutan avatar ryanrutan commented on July 18, 2024

If possible, let's try to have these discussions in the Jive Community for best visibility.
https://community.jivesoftware.com/community/developer

As a possible suggestion, with Heroku, did you change the port from 8090 to 80?

from jive-sdk.

jeffweiss avatar jeffweiss commented on July 18, 2024

@ryanrutan yes, we did make the port number change from 8090 to 80, @theshanx and I explicitly mentioned it above, but it was in the middle so likely easy to overlook.

from jive-sdk.

AaronMalenfant avatar AaronMalenfant commented on July 18, 2024

Heroku doesn't allow you to pick the port you listen on. Instead you need to listen on "process.env.PORT". See app.js "startServer" function and change the line the listens to:
var server = http.createServer(app).listen( process.env.PORT || 5000, function () {

from jive-sdk.

rachoac avatar rachoac commented on July 18, 2024

Hi there, here is how my app.js looks like, to make it work with heroku. Notice I am using mongoDB. Because Heroku has a virtual file system, file persistence will not work, so you will need to setup using mongoDB in heroku. Your package.json should have this dependency:

"jive-persistence-mongo" : "*"

And your jiveclientconfiguration.json should have this:

"persistence" : "jive-persistence-mongo"

Here is my app.js:

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') || 8090, function () {
            console.log("Express server listening on port " + server.address().port);
        });
    }
};

jive.util.fsreadJson('jiveclientconfiguration.json').then( function(options) {
    options['port'] = process.env.PORT || options['port'];
    options['databaseUrl'] =  process.env.MONGOLAB_URI || process.env.MONGOHQ_URL ||    options['databaseUrl'];
    jive.service.init(app, options)
        .then( function() { return jive.service.autowire() } )
        .then( function() { return jive.service.start() } ).then( startServer, failServer );
});

from jive-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.