I'm trying to push my MEAN-Application, which I created locally using express, to OpenShift. For that, I create a new application from the dashboard and add NodeJS as a cartridge. When I then add my Git-Repository-URL (Hosted on BitBucket) and create the application, I get the following error:
When I create a new application without entering the repository URL and then pull from Openshift, copy in my Project and Push again, I get a similar error:
It seems to be some problem with port 8080 being unavailable but I cant resolve this myself as I'm new to this and couldn't find a solution on the web, so any help & advice is appreciated.
EDIT: when I say MEAN I actually mean EAN; I don't use MongoDB at the moment.
EDIT 2: after several hours I decided to try Heroku. It also didn't work on the first try but the Log contained far more useful information so I got everything up and running in about an hour (compared to like 4 hours of trying with OpenShift). After that I tried to push the exact same Project I pushed to Heroku to Openshift and got the following, new error:
Again, if somebody happens to know a quick fix for this please tell me as I would still like to use OpenShift.
What worked for me was the following:
git remote add openshift -f <openshift-git-repo-url
(ssh://...something)>
to add the Openshift-Repo as a remote Repo to your Project.git merge openshift/master -s recursive -X ours
to merge the Openshift-Repo into your local Repo and keep your files if conflicts appear.(And this is the important step) Your main File (bin/www for me) has to look something like this (I tried everything to format this but it just didn't format properly):
var app = require('../app'); var debug = require('debug')('CTW:server'); var http = require('http');
/**
/**
var server = http.createServer(app);
/**
server.listen(app.get('port') ,app.get('ip'));
git push openshift HEAD
to push it to your Application Repo
As it turns out, I had to set the IP.