Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1039 from ryanjbaxter/bluemix-mongo-changes
Browse files Browse the repository at this point in the history
Switched to using new MongoDB service in Bluemix
  • Loading branch information
lirantal committed Nov 4, 2015
2 parents 829a7de + 7340e68 commit 61ea25c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ $ wget https://github.com/meanjs/mean/archive/master.zip -O meanjs.zip; unzip me

Don't forget to rename **mean-master** after your project name.

### Yo Generator
### Yo Generator
-Another way would be to use the [Official Yo Generator](http://meanjs.org/generator.html), which generates a copy of the MEAN.JS 0.3.x boilerplate and supplies multiple sub-generators to ease your daily development cycles.

## Quick Install
Expand Down Expand Up @@ -257,17 +257,17 @@ We welcome pull requests from the community! Just be sure to read the [contribut
Cloud Foundry is an open source platform-as-a-service (PaaS). The MEANJS project
can easily be deployed to any Cloud Foundry instance. The easiest way to deploy the
MEANJS project to Cloud Foundry is to use a public hosted instance. The two most popular
instances are [Pivotal Web Services](https://run.pivotal.io/) and
instances are [Pivotal Web Services](https://run.pivotal.io/) and
[IBM Bluemix](https://bluemix.net). Both provide free trials and support pay-as-you-go models
for hosting applications in the cloud. After you have an account follow the below steps to
deploy MEANJS.
for hosting applications in the cloud. After you have an account follow the below steps to deploy MEANJS.

* Install the [Cloud Foundry command line tools](http://docs.cloudfoundry.org/devguide/installcf/install-go-cli.html).
* Now you need to log into Cloud Foundry from the Cloud Foundry command line.
* If you are using Pivotal Web Services run `$ cf login -a api.run.pivotal.io`.
* If you are using IBM Bluemix run `$ cf login -a api.ng.bluemix.net`.
* Create a Mongo DB service, IBM Bluemix and Pivotal Web Services offer a free MongoLabs service.
* `$ cf create-service mongolab sandbox mean-mongo`
* Create a Mongo DB service.
+ * If you are using Pivotal Web Services run `$ cf create-service mongolab sandbox mean-mongo`
+ * If you are using IBM Bluemix run `$ cf create-service mongodb 100 mean-mongo`
* Clone the GitHub repo for MEANJS if you have not already done so
* `$ git clone https://github.com/meanjs/mean.git && cd mean`
* Run `$ npm install`
Expand Down Expand Up @@ -321,4 +321,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 changes: 9 additions & 3 deletions config/env/cloud-foundry.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
'use strict';

var cfenv = require('cfenv'),
appEnv = cfenv.getAppEnv(),
cfMongoUrl = appEnv.getService('mean-mongo') ?
appEnv.getService('mean-mongo').credentials.uri : undefined;
appEnv = cfenv.getAppEnv();
var cfMongoUrl = (function() {
if (appEnv.getService('mean-mongo')) {
var mongoCreds = appEnv.getService('mean-mongo').credentials;
return mongoCreds.uri || mongoCreds.url;
} else {
throw new Error('No service names "mean-mongo" bound to the application.');
}
}());

var getCred = function (serviceName, credProp) {
return appEnv.getService(serviceName) ?
Expand Down
8 changes: 4 additions & 4 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
declared-services:
mean-mongo:
label: mongolab
plan: sandbox
declared-services:
mean-mongo:
label: mongodb
plan: 100
applications:
- name: mean
host: mean-${random-word}
Expand Down

0 comments on commit 61ea25c

Please sign in to comment.