0

I would like to seek help on how to create a REST services using Node.JS in Raspberry PI. A simple REST services which can gather data from the sensors and write to SQLite database or Windows Azure's SQL Database. Hardware I will be using is Raspberry PI.

  • You want to collect sensor data locally on the RPi and then make them available via REST using NodeJS? Did I get it right? – Marco Poli Jul 8 '14 at 17:44
  • Yes, Marco Poli. – user3127380 Jul 9 '14 at 0:37
1

You'll need to first install the node.js package compatible with ARM:

sudo apt-get update
sudo apt-get upgrade
wget http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-arm-pi.tar.gz
tar -xvzf node-v0.10.26-linux-arm-pi.tar.gz

Now add this to your .bash_profile

NODE_JS_HOME=/home/pi/node-v0.10.26-linux-arm-pi
PATH=$PATH:$NODE_JS_HOME/bin

source

From there you can install express.js which you can use for your api

  • I just followed your steps and installed, hagope. What should I do next? – user3127380 Jul 9 '14 at 2:47
  • @user3127380 we aren't going to code your project for you, you need to do it yourself. We can help you with the Pi-specific bits, but ultimately you need to do the bulk of the work. – whiskers75 Jul 9 '14 at 7:22
0

Take a look at this tutorial of how to use express 4 (last version so far), this is an amazing module, it provides a lot of power, just what you are looking for

Node.js + express + rest + mondoDB

http://webapplog.com/express-js-4-node-js-and-mongodb-rest-api-tutorial/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.