This is the full code for the Simple Nodebot for the JavaScript with Hardware. This includes the code for Arduino, a simple web interface, and a node server. If you're stuck with the code, feel free to use as a reference!
To install dependencies, simple install via NPM.
npm install
Alternatively, you can use Yarn. I personally prefer Yarn.
yarn install
This Nodebot has a set of scripts for development and production uses. Simply use node
or yarn
to run them.
start
— Starts the development server on port 8000 usingbabel-node
.dev
— Starts Webpack and watches for changes inbrowser.js
.build
— Makes a compiled copy of the browser and server code.test
— Tests all scripts using ESLint and Flow. (Note: uses Yarn to run command).production
— Runs the compiled server code.
Feel free to open an issue! Hopefully you won't have any problems, but be sure to file any issues that may arise.
Do you enjoy the JavaScript with Hardware series? Feel free to support me by following me on Twitter and subscribe to my mailing list to get updates!