Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Testing Ospriet

couch edited this page · 22 revisions

Start your local MongoDB database server

mongod --dbpath /path/to/data/db

You must do this before starting the application so that it can properly connect to the database.

Start your application

Start your application in development mode:

NODE_ENV=development node server.js

If you plan to actively edit the application though, using nodemon is recommended. nodemon monitors all of your app's files for changes and automatically restarts the server if any change is detected. Using nodemon:

NODE_ENV=development nodemon server.js

Once running, visit http://localhost:3000. You should see the site, and any @-replies to and favorites on your Twitter account posted while the app is running should automatically appear in the interface. At this point, you modify the views/templates as you see fit for your version of Ospriet.

Editing your MongoDB database from console

If you're having issues with favorites being stored, you may want to connect to the database, see what it contains and empty it if you need to 'reset' the database.

Local

To start your local MongoDB interactive shell:

mongo

Your local database can have multiple collections, so once started, to see all collections:

show collections

To use Ospriet's favorites collection:

use favorites

Server

To start your remote MongoDB interactive shell:

/usr/local/path/to/mongo -u nodejitsu -p XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX staff.mongohq.com:10040/nodejitsudbXXXXXXXXXXXX

where the path is the location of your Mongo install, and the Xs are the values given to you when you create a new database with jitsu.

Useful MongoDB methods

To see all the documents in your favorites collection on either instance:

db.favorites.find()

If you'd like to empty the collection from testing:

db.favorites.remove()

☞ For more information on starting your database server, consult MongoDB's quickstart guide.

☞ To learn more about MongoDB methods, consult MongoDB's manual.

Next: Working with nodejitsu →

Something went wrong with that request. Please try again.