/meteorshift

Meteor.js on Red Hat OpenShift

Primary LanguageJavaScript

The OpenShift nodejs cartridge documentation can be found at:

http://openshift.github.io/documentation/oo_cartridge_guide.html#nodejs

Steps

  1. Create the OpenShift app
  2. Add the MongoDB database
  3. Update package.json

Add the MongoDB database

WARNING: If you're on an old vesion of OpenShift make sure to write down the MongoDB database name, admin id, and addmin password because that information won't be available on the application information page. If you're on a new version of OpenShift you can look this information up later. I'm not sure what version number implemented this change.

Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/

Update package.json

You'll need to update the developer and application information. Most importantly, the following sections need to be written.

Here is the default generated by OpenShift:

"engines": {
  "node": ">= 0.6.0",
  "npm": ">= 1.0.0"
},

"dependencies": {
  "express": "~3.4.4"
},
"devDependencies": {},
"bundleDependencies": [],

"private": true,
"main": "server.js"

Here is the rewrite:

"engines": {
  "node": ">= 0.10.29",
  "npm": ">= 1.0.0"
},

"dependencies": {
  "fibers": "~1.0.0"
},
"devDependencies": {},
"bundleDependencies": [],

"private": true,
"scripts": {
  "start": "node meteorshim.js"
},
"main": "meteorshim.js"

Notes...

  • The current version of Meteor.js is tested on Node.js 0.10.9
  • meteorshim.js is necessary to bootstrap the application.
  • meteorshim.js has replaced server.js
  • fibers has been added as a dependency and express has been removed

Add meteorshim.js

See the OpenShift MeteorJS Quickstart for an example meteorshim.js file.

Remove server.js

git rm server.js

Remove index.html

git rm index.html

Deploy the app

References

Cloudy With a Chance of Meteor.js

OpenShift MeteorJS Quickstart