Skip to content

Commit 1af4499

Browse files
committed
updating README notes to match MongoDB usage info
1 parent 247af41 commit 1af4499

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# Map of National Parks and Historic Sites
2-
*powered by RESTify, PostGIS, and Leaflet maps*
2+
*powered by Restify, MongoDB, and Leaflet maps*
33

4-
A basic instant mapping demo using PostGIS, node-restify, LeafLet Maps and map tiles from Stamen, to visualize the locations of major National Parks and Historic Sites.
4+
A basic instant mapping demo using MongoDB, node-restify, LeafLet Maps and map tiles from Stamen, to visualize the locations of major National Parks and Historic Sites.
55

6-
<a href='http://nodegis-shifter.rhcloud.com/'><img src='https://www.openshift.com/sites/default/files/Parks_preview.png'/></a>
6+
<a href='http://parks-shifter.rhcloud.com/'><img src='https://www.openshift.com/sites/default/files/Parks_preview.png'/></a>
77

88
Related post on OpenShift.com: [https://www.openshift.com/blogs/instant-mapping-applications-with-postgis-and-nodejs](https://www.openshift.com/blogs/instant-mapping-applications-with-postgis-and-nodejs)
99

1010
## Instant Provisioning on OpenShift
1111
To deploy a clone of this application using the [`rhc` command line tool](http://rubygems.org/gems/rhc), type:
1212

13-
rhc app create parks nodejs-0.10 postgresql-9.2 --from-code=https://github.com/ryanj/restify-postGIS.git
13+
rhc app create parks nodejs-0.10 mongodb-2.2 --from-code=https://github.com/ryanj/restify-mongodb-parks.git
1414

15-
Or, [link to a web-based **clone+deploy**](https://openshift.redhat.com/app/console/application_type/custom?name=parks&cartridges%5B%5D=nodejs-0.10&cartridges%5B%5D=postgresql-9.2&initial_git_url=https%3A%2F%2Fgithub.com%2Fryanj%2Frestify-postGIS.git) on [OpenShift Online](http://OpenShift.com) or [your own open cloud](http://openshift.github.io):
15+
Or, [link to a web-based **clone+deploy**](https://openshift.redhat.com/app/console/application_type/custom?name=parks&cartridges%5B%5D=nodejs-0.10&cartridges%5B%5D=mongodb-2.2&initial_git_url=https%3A%2F%2Fgithub.com%2Fryanj%2Frestify-mongodb-parks.git) on [OpenShift Online](http://OpenShift.com) or [your own open cloud](http://openshift.github.io):
1616

17-
https://openshift.redhat.com/app/console/application_type/custom?name=parks&cartridges%5B%5D=nodejs-0.10&cartridges%5B%5D=postgresql-9.2&initial_git_url=https%3A%2F%2Fgithub.com%2Fryanj%2Frestify-postGIS.git
17+
https://openshift.redhat.com/app/console/application_type/custom?name=parks&cartridges%5B%5D=nodejs-0.10&cartridges%5B%5D=mongodb-2.2&initial_git_url=https%3A%2F%2Fgithub.com%2Fryanj%2Frestify-mongodb-parks.git
1818

19-
A live demo is available at: [http://nodegis-shifter.rhcloud.com/](http://nodegis-shifter.rhcloud.com/)
19+
A live demo is available at: [http://parks-shifter.rhcloud.com/](http://parks-shifter.rhcloud.com/)
2020

2121
## Local Development
2222
Before you spin up a local server, you'll need a copy of the source code, and an installation of [nodejs](http://nodejs.org/).
@@ -30,7 +30,7 @@ OpenShift will automatically resolve `package.json` dependencies for hosted appl
3030
npm install
3131

3232
### port-forwarding for local access to your remote db
33-
You can set up your own postgreSQL database for local development. But, OpenShift provides a great way to get connected to your fully hosted and configured PostgreSQL database in mere seconds.
33+
You can set up your own MongoDB database for local development. But, OpenShift provides a great way to get connected to your fully hosted and configured DB in mere seconds
3434

3535
The `rhc port-forward` command establishes a local connection to your hosted database, where your DB permissions, table schema, and map data have already been initialized.
3636

@@ -39,19 +39,19 @@ The command output will provides your local connection details:
3939
Service Local OpenShift
4040
---------- -------------- ---- ----------------
4141
node 127.0.0.1:8080 => 127.5.199.1:8080
42-
postgresql 127.0.0.1:5433 => 127.5.199.2:5432
42+
mongodb 127.0.0.1:27017 => 127.5.199.2:27017
4343

4444
Press CTRL-C to terminate port forwarding
4545

46-
Make a note of the *local* postgresql IP address and port number, and leave the command running (in order to keep the connection open). We will need to use these values in the next step.
46+
Make a note of the *local* MongoDB IP address and port number, and leave the command running (in order to keep the connection open). We will need to use these values in the next step.
4747

4848
### Basic Configuration
4949
This app uses the `config` npm module, which loads it's configuration details from the `config/defaults.json` file. This configuration takes advantage of several environment variables whenever they are available. On OpenShift, many of these values are automatically provided for your application by their associated cartridge add-on service:
5050

5151
module.exports = {
5252
port: process.env.PORT || process.env.OPENSHIFT_NODEJS_PORT || 3000,
5353
ip: process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1',
54-
pg_config: process.env.OPENSHIFT_POSTGRESQL_DB_URL || 'postgresql://127.0.0.1:5432',
54+
db_config: process.env.OPENSHIFT_MONGODB_DB_URL || 'mongodb://127.0.0.1:27017',
5555
table_name: process.env.OPENSHIFT_APP_NAME || 'parks'
5656
}
5757

@@ -66,26 +66,26 @@ You can find this information by running `env` while connected to your OpenShift
6666
### Environment Variables
6767
Now, set your `OPENSHIFT_POSTGRESQL_DB_URL` environment variable, substituting your own `DB_USERNAME`, `DB_PASSWORD`, `LOCAL_DB_IP`, and `LOCAL_DB_PORT`:
6868

69-
export OPENSHIFT_POSTGRESQL_DB_URL="postgres://DB_USERNAME:DB_PASSWORD@LOCAL_DB_IP:LOCAL_DB_PORT"
69+
export OPENSHIFT_MONGODB_DB_URL="mongodb://DB_USERNAME:DB_PASSWORD@LOCAL_DB_IP:LOCAL_DB_PORT"
7070

7171
My application's command ended up looking like this:
7272

73-
export OPENSHIFT_POSTGRESQL_DB_URL="postgres://admin32jk510:[email protected]:5433"
73+
export OPENSHIFT_MONGODB_DB_URL="mongodb://admin32jk510:[email protected]:5433"
7474

75-
This app also expects to use a Postgres `table_name` that matches your application's name (as defined within OpenShift). When running this application on OpenShift, the `OPENSHIFT_APP_NAME` environment variable will be automatically populated. If you didn't name your application "parks" (the default value for this option), then you will likely need to set an extra environment variable containing your table name in your local dev environment:
75+
This app also expects to use a MongoDB collection name (`table_name`) that matches your application's name (as defined within OpenShift). When running this application on OpenShift, the `OPENSHIFT_APP_NAME` environment variable will be automatically populated. If you didn't name your application "parks" (the default value for this option), then you will likely need to set an extra environment variable containing your table name in your local dev environment:
7676

7777
export OPENSHIFT_APP_NAME=parks
7878

7979
#### Testing your connection
80-
You can verify that your port-forwarding tunnel is active, and that your environment variables are configured correctly by using them to make a DB connection using the `psql` command-line client:
80+
You can verify that your port-forwarding tunnel is active, and that your environment variables are configured correctly by using them to make a DB connection using the `mongo` command-line client:
8181

82-
psql $OPENSHIFT_POSTGRESQL_DB_URL/$OPENSHIFT_APP_NAME
82+
mongo $OPENSHIFT_MONGODB_DB_URL/$OPENSHIFT_APP_NAME
8383

8484
This should provide a direct connection to your OpenShift-hosted database instance.
8585

8686
Here you can verify that your application's [automatic database import procedures](https://www.openshift.com/blogs/instant-mapping-applications-with-postgis-and-nodejs#bootstrapping) have successfully completed, by checking the number of records in our DB table:
8787

88-
select count(*) from parks;
88+
db.parks.count;
8989

9090
The result should be `547`. As usual, if you named your application something other than `parks`, you'll need to modify above the command to match your particular configuration.
9191

0 commit comments

Comments
 (0)