Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Ben's bit:

How to get a mongo/node instance up and running so that you can play with it.

Get a Heroku account

Do this tutorial up until the 'Provision a database' step


except in Prepare the app when it asks you to clone the repo, clone this repo instead.

The following steps are from here:

add a new database:

$ heroku addons:create mongolab

Then find it's connection uri:

$  heroku config | grep MONGODB_URI

At the bottom of your index.js change this line to be yout URI (i.e. not mine):

// Connect to Mongo on start
var mongoURL = 'mongodb://heroku_d58bh1wm:m3f37fh3q0sodg1lct1vbb97s0@ds063899.mlab.com:63899/heroku_d58bh1wm'; // <-- but put in YOUR one from the step above

Then git commit and git push heroku master

Your app should be working now!

A route is the bit after the first / that tells the app what page to go to, or in our case, what do do with the data we're going to flick at it.

In index.js There are two useful routes. I've used URL params to make it easier to test.

The first is /in-url-params which takes two params rssi and base. What these words are isn't really important. Just think of them as some things that you are sending to the server. It could be anything eventualy. You'd use this like this:


The second is /out-url-params-base which lists all the entrys for a particular base.


This assumes a really simple model where the data gets thrown at the server by the RPi, the server saves it and then later on you'd query the data.

In reality the saving would be made safer, and the query would be much more interesting, but it's a start.

Heroku's bit


A barebones Node.js app using Express 4.

This application supports the Getting Started with Node on Heroku article - check it out.

Running Locally

Make sure you have Node.js and the Heroku Toolbelt installed.

$ git clone git@github.com:heroku/node-js-getting-started.git ## or clone your own fork
$ cd node-js-getting-started
$ npm install
$ npm start

Your app should now be running on localhost:5000.

Deploying to Heroku

$ heroku create
$ git push heroku master
$ heroku open


Deploy to Heroku


For more information about using Node.js on Heroku, see these Dev Center articles: