Closed dnnagy closed 9 years ago
same issue. Any solution?
I can't say that I've tried OpenShift, but I've been using Heroku without any issues for a few months. Can you post some example code on how you construct your agent object?
On Tue, Oct 13, 2015 at 8:53 PM, Phaninder Pasupula < notifications@github.com> wrote:
same issue. Any solution?
— Reply to this email directly or view it on GitHub https://github.com/logicalparadox/apnagent/issues/35#issuecomment-147894126 .
same issue, Exactly same error activating gear
Thank you @ajostergaard for quick reply , i have tried your solution it is working perfectly . But when i include package body-parser and morgan , it results the same error
my code: var express = require('express'); var bodyParser=require('body-Parser'); var morgan=require('morgan'); var app = express(); var http = require('http');
app.use(bodyParser.urlencoded({extended:true})); app.use(bodyParser.json()); app.use(morgan('dev'));
app.get('/', function (req, res) { res.send('Hello World!'); });
var ipaddress = process.env.OPENSHIFT_NODEJS_IP; var port = process.env.OPENSHIFT_NODEJS_PORT; if(typeof ipaddress === "undefined"){ ipaddress = "127.0.0.1"; port = 3000; } app.listen(port, ipaddress, function() { // Do your stuff console.log("Your server is running on: "+ipaddress+" port:"+port); });
if i comment out all the packages excluding express, it works fine ...
@iamdangerous I suggest making sure it works locally before trying it on openshift however clearly not an apnagent issue.
@kommancs96 i suggest closing this issue.
well its working 100% fine in local machine, please look at this post (the answer) , i want to know is there any to use node version 0.12.X , i mean the latest version in server side (on openshift), i think may be node 0.10 (running on openshift) doesn't support latest packages, thats why i am this issue
Be that as it may this has nothing to do with apnagent.
Have you tried node 10 on your local machine?
@ajostergaard thanks for keeping patience , and helping me everytime, i am an idiot, i was ignoring it all the time ,it was my silly mistake my 2nd line of code -->var bodyParser=require('body-Parser');<-- this was creating issue, i was importing wrong package all the time the package should be 'body-parser' (case-sensitive) .. Now , everything is working fine locally and remotely . Again thanks for your help .
most of the times this issue occurs because of the error in scripts or compilation silly human errors :)
I'm developing a website , that should send push notifications to iOS devices. On my localhost apnagent works fine, but when I
git push
it to Openshift cloud I get the following errors in the terminal:My package.json looks like this:
I think i should use somehow
process.env.OPENSHIFT_NODEJS_PORT
as port on the server, or something like this. I'm sure, I've done some configuration mistake since on my local machine everything works fine.