Node.js is a scalable web servers which uses an event-driven and non-blocking I/O model. node.js is lightweight, efficient, and consists of Google’s V8 JavaScript engine.
Assuming you have a working installation of node.js. Please refer to your Distribution’s package management system about installing node.js. After the installation of node.js open a terminal and execute the command below.
1 |
node -v |
This should display the version of node.js.
Now it’s time to switch to the node_server in your Breakout directory. First change the serial port to match yours.
1 |
sed -i 's|/dev/tty.usbmodemfd121|/dev/ttyACM0|g' server.js |
As a requirement serialport is needed.
1 |
npm install serialport |
Now start it:
1 |
nodejs server.js |