The OpenShift nodejs
cartridge documentation can be found at:
http://openshift.github.io/documentation/oo_cartridge_guide.html#nodejs
- Create the OpenShift app
- Add the MongoDB database
- Update
package.json
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/
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 onNode.js
0.10.9 meteorshim.js
is necessary to bootstrap the application.meteorshim.js
has replacedserver.js
fibers
has been added as a dependency andexpress
has been removed
See the OpenShift MeteorJS Quickstart for an example meteorshim.js
file.
git rm server.js
git rm index.html