Skip to content

Commit 7340e68

Browse files
committed
Switched to using new MongoDB service in Bluemix since MongoLabs is being removed
1 parent 1cd909a commit 7340e68

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $ wget https://github.com/meanjs/mean/archive/master.zip -O meanjs.zip; unzip me
5959

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

62-
### Yo Generator
62+
### Yo Generator
6363
-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.
6464

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

204203
* Install the [Cloud Foundry command line tools](http://docs.cloudfoundry.org/devguide/installcf/install-go-cli.html).
205204
* Now you need to log into Cloud Foundry from the Cloud Foundry command line.
206205
* If you are using Pivotal Web Services run `$ cf login -a api.run.pivotal.io`.
207206
* If you are using IBM Bluemix run `$ cf login -a api.ng.bluemix.net`.
208-
* Create a Mongo DB service, IBM Bluemix and Pivotal Web Services offer a free MongoLabs service.
209-
* `$ cf create-service mongolab sandbox mean-mongo`
207+
* Create a Mongo DB service.
208+
+ * If you are using Pivotal Web Services run `$ cf create-service mongolab sandbox mean-mongo`
209+
+ * If you are using IBM Bluemix run `$ cf create-service mongodb 100 mean-mongo`
210210
* Clone the GitHub repo for MEANJS if you have not already done so
211211
* `$ git clone https://github.com/meanjs/mean.git && cd mean`
212212
* Run `$ npm install`
@@ -260,4 +260,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
260260
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
261261
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
262262
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
263-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
263+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

config/env/cloud-foundry.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
'use strict';
22

33
var cfenv = require('cfenv'),
4-
appEnv = cfenv.getAppEnv(),
5-
cfMongoUrl = appEnv.getService('mean-mongo') ?
6-
appEnv.getService('mean-mongo').credentials.uri : undefined;
4+
appEnv = cfenv.getAppEnv();
5+
var cfMongoUrl = (function() {
6+
if (appEnv.getService('mean-mongo')) {
7+
var mongoCreds = appEnv.getService('mean-mongo').credentials;
8+
return mongoCreds.uri || mongoCreds.url;
9+
} else {
10+
throw new Error('No service names "mean-mongo" bound to the application.');
11+
}
12+
}());
713

814
var getCred = function (serviceName, credProp) {
915
return appEnv.getService(serviceName) ?

manifest.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
declared-services:
3-
mean-mongo:
4-
label: mongolab
5-
plan: sandbox
2+
declared-services:
3+
mean-mongo:
4+
label: mongodb
5+
plan: 100
66
applications:
77
- name: mean
88
host: mean-${random-word}

0 commit comments

Comments
 (0)