I have a mobile (Ionic 2) chat application with the following implementation, that uses nodejs-0.10
and MongoDB 3.2.7
and Meteor 1.4.1.1
. It works perfectly on my localhost
.
Now I need to deploy it to an OpenShift server. I have followed the following steps and created a server on OpenShift with Meteor
. It is connecting with Git, and I can push my code to the server.
I am pretty sure the Meteor
server is running on OpenShift, because I saw something to that effect on the startup logs (via ssh). However, I am not sure how to connect to the Meteor
server to test it.
The domain is nodejs-easyjobs.rhcloud.com
(54.208.77.250
) on the OpenShift server, I can ping this successfully.
I am using Ionic 2 to build the mobile app. I am currently just running on Android
, but plan to add iOS
and Windows
.
I am following this tutorial, and it runs on localhost
. However, I am not sure where this is configured. I guess localhost is default, and you need to change it to a different host if needs be.
If I check my OpenShift server (nodejs-easyjobs.rhcloud.com
) via ssh, I can see that the contents of the Meteor bundle directory is on the server. So Git is pushing the code.
The part I don't understand is:
- Do I need to configure Meteor differently for being on the OpenShift Server? Or do I just leave it as is?
- Where do I configure the client (Ionic 2) to point to the OpenShift server?
Question:
My question is, how do I configure my mobile app (Ionic 2) to connect to the OpenShift Meteor Server?
UPDATE:
My dir structure:
openshift-appname
.../ionic-apps/nodejs/bundle/server/...
meteorapp
.../ionic-aps/myIonicApp/api/.meteor/...
.../ionic-aps/myIonicApp/api/server/...
The contents of the .../ionic-apps/nodejs
is cloned on the OpenShift server with Git.
I followed this tutorial to deploy the Meteor bundle to OpenShift. `
So I used the following to build my Meteor app:
> cd .../ionic-aps/myIonicApp/
> meteor build .../ionic-apps/nodejs --directory --server-only
As far as I can see, I may be wrong, but the Meteor Server is all correct and running on OpenShift. I need to know how I can get my Ionic2 app to access it.
- Step1: Find the access point to the Meteor server using the OpenShift
IP. i.e.
nodejs-easyjobs.rhcloud.com (54.208.77.250)
. - Step2: Configure my Ionic2 client to use this.